@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.
- package/lib/browser/ai-configuration/ai-configuration-category-registry.d.ts +29 -0
- package/lib/browser/ai-configuration/ai-configuration-category-registry.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-category-registry.js +83 -0
- package/lib/browser/ai-configuration/ai-configuration-category-registry.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-category-registry.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/ai-configuration-category-registry.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-category-registry.spec.js +122 -0
- package/lib/browser/ai-configuration/ai-configuration-category-registry.spec.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-category.d.ts +204 -0
- package/lib/browser/ai-configuration/ai-configuration-category.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-category.js +86 -0
- package/lib/browser/ai-configuration/ai-configuration-category.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-selection-model.d.ts +15 -0
- package/lib/browser/ai-configuration/ai-configuration-selection-model.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-selection-model.js +44 -0
- package/lib/browser/ai-configuration/ai-configuration-selection-model.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.d.ts +48 -0
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.js +98 -0
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.spec.js +70 -0
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.spec.js.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-components.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/components/ai-configuration-components.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-components.spec.js +596 -0
- package/lib/browser/ai-configuration/components/ai-configuration-components.spec.js.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-controls.d.ts +118 -0
- package/lib/browser/ai-configuration/components/ai-configuration-controls.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-controls.js +191 -0
- package/lib/browser/ai-configuration/components/ai-configuration-controls.js.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-item-row.d.ts +57 -0
- package/lib/browser/ai-configuration/components/ai-configuration-item-row.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-item-row.js +48 -0
- package/lib/browser/ai-configuration/components/ai-configuration-item-row.js.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-origin-badge.d.ts +49 -0
- package/lib/browser/ai-configuration/components/ai-configuration-origin-badge.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-origin-badge.js +79 -0
- package/lib/browser/ai-configuration/components/ai-configuration-origin-badge.js.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-primitives.d.ts +161 -0
- package/lib/browser/ai-configuration/components/ai-configuration-primitives.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-primitives.js +131 -0
- package/lib/browser/ai-configuration/components/ai-configuration-primitives.js.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-setting-row.d.ts +54 -0
- package/lib/browser/ai-configuration/components/ai-configuration-setting-row.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/ai-configuration-setting-row.js +77 -0
- package/lib/browser/ai-configuration/components/ai-configuration-setting-row.js.map +1 -0
- package/lib/browser/ai-configuration/components/ai-settings-row-service.d.ts +194 -0
- package/lib/browser/ai-configuration/components/ai-settings-row-service.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/ai-settings-row-service.js +352 -0
- package/lib/browser/ai-configuration/components/ai-settings-row-service.js.map +1 -0
- package/lib/browser/ai-configuration/components/ai-settings-row-service.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/components/ai-settings-row-service.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/ai-settings-row-service.spec.js +233 -0
- package/lib/browser/ai-configuration/components/ai-settings-row-service.spec.js.map +1 -0
- package/lib/browser/ai-configuration/components/ai-settings-row.d.ts +50 -0
- package/lib/browser/ai-configuration/components/ai-settings-row.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/ai-settings-row.js +85 -0
- package/lib/browser/ai-configuration/components/ai-settings-row.js.map +1 -0
- package/lib/browser/ai-configuration/components/collapsible-list.d.ts +65 -0
- package/lib/browser/ai-configuration/components/collapsible-list.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/collapsible-list.js +82 -0
- package/lib/browser/ai-configuration/components/collapsible-list.js.map +1 -0
- package/lib/browser/ai-configuration/components/prompt-customization-dialogs.d.ts +35 -0
- package/lib/browser/ai-configuration/components/prompt-customization-dialogs.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/prompt-customization-dialogs.js +83 -0
- package/lib/browser/ai-configuration/components/prompt-customization-dialogs.js.map +1 -0
- package/lib/browser/ai-configuration/components/variant-set-card.d.ts +25 -0
- package/lib/browser/ai-configuration/components/variant-set-card.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/variant-set-card.js +133 -0
- package/lib/browser/ai-configuration/components/variant-set-card.js.map +1 -0
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.d.ts +44 -0
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.js +106 -0
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.js.map +1 -0
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.spec.js +120 -0
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.spec.js.map +1 -0
- package/lib/browser/ai-configuration/renderers/single-page-category-renderer.d.ts +15 -0
- package/lib/browser/ai-configuration/renderers/single-page-category-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/renderers/single-page-category-renderer.js +20 -0
- package/lib/browser/ai-configuration/renderers/single-page-category-renderer.js.map +1 -0
- package/lib/browser/ai-core-ui-frontend-module.d.ts +1 -0
- package/lib/browser/ai-core-ui-frontend-module.d.ts.map +1 -1
- package/lib/browser/ai-core-ui-frontend-module.js +11 -0
- package/lib/browser/ai-core-ui-frontend-module.js.map +1 -1
- package/package.json +6 -5
- package/src/browser/ai-configuration/ai-configuration-category-registry.spec.ts +137 -0
- package/src/browser/ai-configuration/ai-configuration-category-registry.ts +79 -0
- package/src/browser/ai-configuration/ai-configuration-category.ts +246 -0
- package/src/browser/ai-configuration/ai-configuration-selection-model.ts +42 -0
- package/src/browser/ai-configuration/ai-configuration-setting-commands.spec.ts +82 -0
- package/src/browser/ai-configuration/ai-configuration-setting-commands.ts +104 -0
- package/src/browser/ai-configuration/components/ai-configuration-components.spec.ts +655 -0
- package/src/browser/ai-configuration/components/ai-configuration-controls.tsx +382 -0
- package/src/browser/ai-configuration/components/ai-configuration-item-row.tsx +127 -0
- package/src/browser/ai-configuration/components/ai-configuration-origin-badge.tsx +114 -0
- package/src/browser/ai-configuration/components/ai-configuration-primitives.tsx +359 -0
- package/src/browser/ai-configuration/components/ai-configuration-setting-row.tsx +154 -0
- package/src/browser/ai-configuration/components/ai-settings-row-service.spec.ts +275 -0
- package/src/browser/ai-configuration/components/ai-settings-row-service.ts +401 -0
- package/src/browser/ai-configuration/components/ai-settings-row.tsx +176 -0
- package/src/browser/ai-configuration/components/collapsible-list.tsx +205 -0
- package/src/browser/ai-configuration/components/prompt-customization-dialogs.ts +89 -0
- package/src/browser/ai-configuration/components/variant-set-card.tsx +200 -0
- package/src/browser/ai-configuration/renderers/collection-category-renderer.spec.ts +126 -0
- package/src/browser/ai-configuration/renderers/collection-category-renderer.tsx +164 -0
- package/src/browser/ai-configuration/renderers/single-page-category-renderer.tsx +41 -0
- package/src/browser/ai-core-ui-frontend-module.ts +14 -1
- package/src/browser/style/ai-configuration-components.css +1410 -0
- package/src/browser/style/index.css +17 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { CommandService, Event } from '@theia/core';
|
|
2
|
+
import { ContextMenuRenderer } from '@theia/core/lib/browser/context-menu-renderer';
|
|
3
|
+
import { PreferenceScope } from '@theia/core/lib/common';
|
|
4
|
+
import { PreferenceDataProperty, PreferenceSchemaService } from '@theia/core/lib/common/preferences/preference-schema';
|
|
5
|
+
import { MarkdownRenderer } from '@theia/core/lib/browser/markdown-rendering/markdown-renderer';
|
|
6
|
+
import { AiConfigurationSettingCommandArgs } from '../ai-configuration-setting-commands';
|
|
7
|
+
import type { SelectOption } from '@theia/core/lib/browser/widgets/select-component';
|
|
8
|
+
import { AiConfigurationService } from '@theia/ai-core/lib/common/ai-configuration-service';
|
|
9
|
+
import { AiConfigurationScope } from '../ai-configuration-category';
|
|
10
|
+
/** Describes which control an `AiSettingsRow` renders for a preference value. */
|
|
11
|
+
export type AiSettingsControl = {
|
|
12
|
+
readonly type: 'boolean';
|
|
13
|
+
} | {
|
|
14
|
+
readonly type: 'string';
|
|
15
|
+
readonly placeholder?: string;
|
|
16
|
+
readonly password?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** `integer` distinguishes a whole-number preference from a fractional one, which must not be rounded. */
|
|
19
|
+
| {
|
|
20
|
+
readonly type: 'number';
|
|
21
|
+
readonly integer?: boolean;
|
|
22
|
+
readonly min?: number;
|
|
23
|
+
readonly max?: number;
|
|
24
|
+
readonly step?: number;
|
|
25
|
+
} | {
|
|
26
|
+
readonly type: 'select';
|
|
27
|
+
readonly options: SelectOption[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* `validate` refuses an entry before it is written, returning the message to show; used where the values
|
|
31
|
+
* are more than free text (shell command patterns, for instance, have wildcard rules).
|
|
32
|
+
*/
|
|
33
|
+
| {
|
|
34
|
+
readonly type: 'array';
|
|
35
|
+
readonly placeholder?: string;
|
|
36
|
+
readonly validate?: (value: string) => string | undefined;
|
|
37
|
+
} | {
|
|
38
|
+
readonly type: 'json';
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The value of a single preference as seen from a particular {@link AiConfigurationScope},
|
|
42
|
+
* together with the information the {@link AiSettingsRow} needs to render the
|
|
43
|
+
* modified indicator and the reset affordance.
|
|
44
|
+
*/
|
|
45
|
+
export interface AiSettingsInspection {
|
|
46
|
+
/** Effective value resolved for the requested scope (falling back through broader scopes and the default). */
|
|
47
|
+
readonly value: unknown;
|
|
48
|
+
/** Value explicitly set in the requested scope; `undefined` means the value is inherited or default. */
|
|
49
|
+
readonly scopeValue: unknown;
|
|
50
|
+
/** Default (schema) value. */
|
|
51
|
+
readonly defaultValue: unknown;
|
|
52
|
+
/** `true` when the requested scope explicitly overrides the value, i.e. a reset is meaningful. */
|
|
53
|
+
readonly modified: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Thin, injectable wrapper around {@link AiConfigurationService} and {@link MarkdownRenderer}
|
|
57
|
+
* used by the presentational {@link AiSettingsRow} component, which must not itself
|
|
58
|
+
* depend on the DI container. Owning renderers/widgets inject this service and pass
|
|
59
|
+
* it down to the row.
|
|
60
|
+
*
|
|
61
|
+
* All preference reads and writes are routed through {@link AiConfigurationService} — the AI
|
|
62
|
+
* configuration seam — rather than the raw `PreferenceService`, so reads are workspace-trust-aware
|
|
63
|
+
* and the whole view stays insulated from how AI preferences are stored (see
|
|
64
|
+
* {@link AiConfigurationService}). Schema introspection still uses {@link PreferenceSchemaService}
|
|
65
|
+
* directly, as it inspects the registered schema shape rather than stored values.
|
|
66
|
+
*/
|
|
67
|
+
export declare class AiSettingsRowService {
|
|
68
|
+
protected readonly aiConfigurationService: AiConfigurationService;
|
|
69
|
+
protected readonly markdownRenderer: MarkdownRenderer;
|
|
70
|
+
protected readonly schemaService: PreferenceSchemaService;
|
|
71
|
+
protected readonly commandService: CommandService;
|
|
72
|
+
protected readonly contextMenuRenderer: ContextMenuRenderer;
|
|
73
|
+
protected changed: Event<void> | undefined;
|
|
74
|
+
/** Fires whenever an AI preference changes (or the workspace-trust state transitions), so owning widgets can re-render their rows. */
|
|
75
|
+
get onPreferenceChanged(): Event<void>;
|
|
76
|
+
inspect(preferenceId: string, scope: AiConfigurationScope, resourceUri?: string): AiSettingsInspection;
|
|
77
|
+
set(preferenceId: string, value: unknown, scope: AiConfigurationScope, resourceUri?: string): Promise<void>;
|
|
78
|
+
reset(preferenceId: string, scope: AiConfigurationScope, resourceUri?: string): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Opens the underlying `settings.json` file focused on a preference, mirroring the
|
|
81
|
+
* Settings view's "Edit in settings.json" link. Used for `json` controls, i.e. complex
|
|
82
|
+
* object/array values that cannot be edited meaningfully through an inline control.
|
|
83
|
+
*/
|
|
84
|
+
editInSettings(preferenceId: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* Opens the gear context menu (Reset Setting / Copy Setting ID / Copy Setting as JSON) anchored below the
|
|
87
|
+
* gear. Uses this view's own {@link AI_CONFIGURATION_SETTING_CONTEXT_MENU} commands, backed by
|
|
88
|
+
* {@link AiConfigurationService} and acting in the row's own `scope` — rather than the Settings UI's
|
|
89
|
+
* `RESET_PREFERENCE` command, which is bound to the Preferences editor widget and misbehaves when invoked
|
|
90
|
+
* from here (it resets in the Preferences widget's scope and disturbs focus in this view).
|
|
91
|
+
*/
|
|
92
|
+
openSettingContextMenu(gear: HTMLElement, preferenceId: string, value: unknown, scope: AiConfigurationScope, resourceUri?: string): void;
|
|
93
|
+
/**
|
|
94
|
+
* Opens the gear menu for a row backed by non-preference data (e.g. a per-agent setting): the same
|
|
95
|
+
* "Reset Setting" affordance as a preference row, but reset runs the given callback. Copy entries are
|
|
96
|
+
* hidden (no preference id). Lets these rows reuse the shared gear menu instead of a bespoke button.
|
|
97
|
+
*/
|
|
98
|
+
openResetMenu(gear: HTMLElement, reset: () => void): void;
|
|
99
|
+
protected openGearMenu(gear: HTMLElement, args: AiConfigurationSettingCommandArgs): void;
|
|
100
|
+
/** Renders a markdown description into a detached element for use in a React `ref`. */
|
|
101
|
+
renderMarkdown(markdown: string): HTMLElement;
|
|
102
|
+
/**
|
|
103
|
+
* Strips the common leading indentation from a markdown description before rendering.
|
|
104
|
+
*
|
|
105
|
+
* Preference `markdownDescription`s are commonly authored as indented, multi-line JavaScript
|
|
106
|
+
* string literals, which leaves every continuation line prefixed with the source indentation.
|
|
107
|
+
* That accidental indentation makes markdown-it collapse bullet lists and paragraphs into a
|
|
108
|
+
* single dense block, so the description reads as an unstructured run-on. Removing the shared
|
|
109
|
+
* indentation (ignoring the first line, which starts right after the opening quote) restores
|
|
110
|
+
* the intended paragraph and list structure while preserving relative indentation, so nested
|
|
111
|
+
* lists stay nested.
|
|
112
|
+
*/
|
|
113
|
+
protected normalizeMarkdown(markdown: string): string;
|
|
114
|
+
/**
|
|
115
|
+
* Reads the label and (already-localized) markdown description a preference declares in its registered
|
|
116
|
+
* schema, so settings rows do not have to re-author those strings. Returns `undefined` fields when the
|
|
117
|
+
* preference is unknown.
|
|
118
|
+
*
|
|
119
|
+
* Most AI preferences share the group `title` ("AI Features") to be grouped together in the Settings UI,
|
|
120
|
+
* which also ignores it and derives each setting's name from its id. We mirror that: a genuinely specific
|
|
121
|
+
* `title` is used as-is, but the shared group title falls back to the humanized preference id (e.g.
|
|
122
|
+
* `ai-features.google.apiKey` → "Api Key") so rows show their own name rather than "AI Features".
|
|
123
|
+
*/
|
|
124
|
+
describe(preferenceId: string): {
|
|
125
|
+
label?: string;
|
|
126
|
+
description?: string;
|
|
127
|
+
};
|
|
128
|
+
/** The schema tags declared for a preference (e.g. `['experimental']`), shown as badges next to the title. */
|
|
129
|
+
tags(preferenceId: string): string[];
|
|
130
|
+
/**
|
|
131
|
+
* Human-readable name for a preference derived from its id. The `ai-features` root and the area segment
|
|
132
|
+
* (`chat`, `google`, …) are dropped — the category/section already conveys them — and the remaining
|
|
133
|
+
* segments are humanized (camelCase split, first letter upper-cased) and joined with ": ", e.g.
|
|
134
|
+
* `ai-features.chat.tokenUsageIndicator.enabled` → "Token Usage Indicator: Enabled",
|
|
135
|
+
* `ai-features.google.apiKey` → "Api Key".
|
|
136
|
+
*/
|
|
137
|
+
protected formatPreferenceName(preferenceId: string): string;
|
|
138
|
+
protected humanizeSegment(segment: string): string;
|
|
139
|
+
protected isUpperCase(char: string): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* The human-readable language-model provider name a preference declares in its schema
|
|
142
|
+
* `typeDetails` (as `{ [MODEL_PROVIDER_TYPE_DETAIL]: { label } }`, see {@link ModelProviderTypeDetail}),
|
|
143
|
+
* or `undefined` when none is declared. The Models page uses this to label a provider block without
|
|
144
|
+
* hard-coding provider names.
|
|
145
|
+
*/
|
|
146
|
+
modelProviderLabel(preferenceId: string): string | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Whether a preference declares itself part of a language-model provider block, i.e. carries the
|
|
149
|
+
* `aiModelProvider` {@link MODEL_PROVIDER_TYPE_DETAIL} typeDetail (in any form). The Models page uses
|
|
150
|
+
* this positive marker to discover provider blocks, so feature areas that never claim to be a provider
|
|
151
|
+
* are never mistaken for one.
|
|
152
|
+
*/
|
|
153
|
+
isModelProviderPreference(preferenceId: string): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Builds {@link SelectOption}s from a preference's `enum`, using its `enumItemLabels`
|
|
156
|
+
* (falling back to `enumDescriptions`, then the raw value) for the display label.
|
|
157
|
+
* Returns an empty array when the preference declares no enum.
|
|
158
|
+
*/
|
|
159
|
+
enumOptions(preferenceId: string): SelectOption[];
|
|
160
|
+
/** All registered preference ids, e.g. to discover a provider's `ai-features.<provider>.*` block. */
|
|
161
|
+
preferenceIds(): string[];
|
|
162
|
+
/** All displayable `ai-features.*` preference ids — every AI setting that should appear somewhere in the view. */
|
|
163
|
+
aiFeaturePreferenceIds(): string[];
|
|
164
|
+
/**
|
|
165
|
+
* Whether a preference is meant to be surfaced as an editable settings row in the AI Configuration
|
|
166
|
+
* view. Excludes only value-less placeholders (`type: 'null'`), such as the redirect entries that
|
|
167
|
+
* only link to this view. The Settings-UI `hidden` flag is intentionally ignored: the AI
|
|
168
|
+
* Configuration view is the dedicated editor for AI preferences, which are hidden from the Settings
|
|
169
|
+
* UI once the cutover (#316) is in effect but must still be editable here.
|
|
170
|
+
*/
|
|
171
|
+
isDisplayable(preferenceId: string): boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Infers a sensible {@link AiSettingsControl} for a preference from its schema `type`
|
|
174
|
+
* (a `select` when it declares an `enum`, a masked text input for secrets/API keys). An `array` of strings
|
|
175
|
+
* gets the inline list editor; more complex values — an `object` or an `array` of objects/other types —
|
|
176
|
+
* cannot be edited meaningfully inline, so they resolve to a `json` control that defers to the
|
|
177
|
+
* `settings.json` file. Falls back to a text input for unknown types.
|
|
178
|
+
*/
|
|
179
|
+
controlFor(preferenceId: string): AiSettingsControl;
|
|
180
|
+
/**
|
|
181
|
+
* Whether an `array` preference holds plain string items, so it can be edited with the inline list editor
|
|
182
|
+
* (matching the Settings UI, which only offers its array input for `string[]`); everything else defers to
|
|
183
|
+
* a `json` control.
|
|
184
|
+
*/
|
|
185
|
+
protected isStringArray(property: PreferenceDataProperty): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Whether a preference holds a secret (an API key, token or password) that should be masked. There is no
|
|
188
|
+
* schema flag for this, so it is inferred from the id's leaf segment, matching how every AI provider names
|
|
189
|
+
* its key preference (e.g. `ai-features.anthropic.apiKey`).
|
|
190
|
+
*/
|
|
191
|
+
protected isSecret(preferenceId: string): boolean;
|
|
192
|
+
protected toPreferenceScope(scope: AiConfigurationScope): PreferenceScope;
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=ai-settings-row-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-settings-row-service.d.ts","sourceRoot":"","sources":["../../../../src/browser/ai-configuration/components/ai-settings-row-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AACvH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAEhG,OAAO,EAAyC,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAGhI,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AAErF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE;AACzF,0GAA0G;GACxG;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7H;I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,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI5C;;;;;OAKG;IACH,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAc5D;;;;;OAKG;IACH,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAKxD;;;;OAIG;IACH,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,YAAY,EAAE;IAiBjD,qGAAqG;IACrG,aAAa,IAAI,MAAM,EAAE;IAIzB,kHAAkH;IAClH,sBAAsB,IAAI,MAAM,EAAE;IAIlC;;;;;;OAMG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAQ5C;;;;;;OAMG;IACH,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,iBAAiB;IAqBnD;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO;IAMlE;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAKjD,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe;CAU5E"}
|
|
@@ -0,0 +1,352 @@
|
|
|
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.AiSettingsRowService = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
21
|
+
const context_menu_renderer_1 = require("@theia/core/lib/browser/context-menu-renderer");
|
|
22
|
+
const common_1 = require("@theia/core/lib/common");
|
|
23
|
+
const preference_schema_1 = require("@theia/core/lib/common/preferences/preference-schema");
|
|
24
|
+
const markdown_renderer_1 = require("@theia/core/lib/browser/markdown-rendering/markdown-renderer");
|
|
25
|
+
const preference_types_1 = require("@theia/preferences/lib/browser/util/preference-types");
|
|
26
|
+
const ai_configuration_setting_commands_1 = require("../ai-configuration-setting-commands");
|
|
27
|
+
const markdown_string_1 = require("@theia/core/lib/common/markdown-rendering/markdown-string");
|
|
28
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
+
const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
|
|
30
|
+
const ai_configuration_service_1 = require("@theia/ai-core/lib/common/ai-configuration-service");
|
|
31
|
+
/**
|
|
32
|
+
* Thin, injectable wrapper around {@link AiConfigurationService} and {@link MarkdownRenderer}
|
|
33
|
+
* used by the presentational {@link AiSettingsRow} component, which must not itself
|
|
34
|
+
* depend on the DI container. Owning renderers/widgets inject this service and pass
|
|
35
|
+
* it down to the row.
|
|
36
|
+
*
|
|
37
|
+
* All preference reads and writes are routed through {@link AiConfigurationService} — the AI
|
|
38
|
+
* configuration seam — rather than the raw `PreferenceService`, so reads are workspace-trust-aware
|
|
39
|
+
* and the whole view stays insulated from how AI preferences are stored (see
|
|
40
|
+
* {@link AiConfigurationService}). Schema introspection still uses {@link PreferenceSchemaService}
|
|
41
|
+
* directly, as it inspects the registered schema shape rather than stored values.
|
|
42
|
+
*/
|
|
43
|
+
let AiSettingsRowService = class AiSettingsRowService {
|
|
44
|
+
/** Fires whenever an AI preference changes (or the workspace-trust state transitions), so owning widgets can re-render their rows. */
|
|
45
|
+
get onPreferenceChanged() {
|
|
46
|
+
return this.changed ??= core_1.Event.map(this.aiConfigurationService.onDidChange, () => undefined);
|
|
47
|
+
}
|
|
48
|
+
inspect(preferenceId, scope, resourceUri) {
|
|
49
|
+
const inspection = this.aiConfigurationService.inspect(preferenceId, resourceUri);
|
|
50
|
+
const defaultValue = inspection?.defaultValue;
|
|
51
|
+
const globalValue = inspection?.globalValue;
|
|
52
|
+
const workspaceValue = inspection?.workspaceValue;
|
|
53
|
+
const folderValue = inspection?.workspaceFolderValue;
|
|
54
|
+
let scopeValue;
|
|
55
|
+
let value;
|
|
56
|
+
switch (scope) {
|
|
57
|
+
case 'user':
|
|
58
|
+
scopeValue = globalValue;
|
|
59
|
+
value = globalValue ?? defaultValue;
|
|
60
|
+
break;
|
|
61
|
+
case 'workspace':
|
|
62
|
+
scopeValue = workspaceValue;
|
|
63
|
+
value = workspaceValue ?? globalValue ?? defaultValue;
|
|
64
|
+
break;
|
|
65
|
+
case 'folder':
|
|
66
|
+
scopeValue = folderValue;
|
|
67
|
+
value = folderValue ?? workspaceValue ?? globalValue ?? defaultValue;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
return { value, scopeValue, defaultValue, modified: scopeValue !== undefined };
|
|
71
|
+
}
|
|
72
|
+
set(preferenceId, value, scope, resourceUri) {
|
|
73
|
+
return this.aiConfigurationService.set(preferenceId, value, this.toPreferenceScope(scope), resourceUri);
|
|
74
|
+
}
|
|
75
|
+
reset(preferenceId, scope, resourceUri) {
|
|
76
|
+
return this.aiConfigurationService.set(preferenceId, undefined, this.toPreferenceScope(scope), resourceUri);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Opens the underlying `settings.json` file focused on a preference, mirroring the
|
|
80
|
+
* Settings view's "Edit in settings.json" link. Used for `json` controls, i.e. complex
|
|
81
|
+
* object/array values that cannot be edited meaningfully through an inline control.
|
|
82
|
+
*/
|
|
83
|
+
editInSettings(preferenceId) {
|
|
84
|
+
this.commandService.executeCommand(preference_types_1.PreferencesCommands.OPEN_PREFERENCES_JSON_TOOLBAR.id, preferenceId);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Opens the gear context menu (Reset Setting / Copy Setting ID / Copy Setting as JSON) anchored below the
|
|
88
|
+
* gear. Uses this view's own {@link AI_CONFIGURATION_SETTING_CONTEXT_MENU} commands, backed by
|
|
89
|
+
* {@link AiConfigurationService} and acting in the row's own `scope` — rather than the Settings UI's
|
|
90
|
+
* `RESET_PREFERENCE` command, which is bound to the Preferences editor widget and misbehaves when invoked
|
|
91
|
+
* from here (it resets in the Preferences widget's scope and disturbs focus in this view).
|
|
92
|
+
*/
|
|
93
|
+
openSettingContextMenu(gear, preferenceId, value, scope, resourceUri) {
|
|
94
|
+
this.openGearMenu(gear, { id: preferenceId, value, scope: this.toPreferenceScope(scope), resourceUri });
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Opens the gear menu for a row backed by non-preference data (e.g. a per-agent setting): the same
|
|
98
|
+
* "Reset Setting" affordance as a preference row, but reset runs the given callback. Copy entries are
|
|
99
|
+
* hidden (no preference id). Lets these rows reuse the shared gear menu instead of a bespoke button.
|
|
100
|
+
*/
|
|
101
|
+
openResetMenu(gear, reset) {
|
|
102
|
+
this.openGearMenu(gear, { reset });
|
|
103
|
+
}
|
|
104
|
+
openGearMenu(gear, args) {
|
|
105
|
+
const rect = gear.getBoundingClientRect();
|
|
106
|
+
this.contextMenuRenderer.render({
|
|
107
|
+
menuPath: ai_configuration_setting_commands_1.AI_CONFIGURATION_SETTING_CONTEXT_MENU,
|
|
108
|
+
anchor: { x: rect.left, y: rect.bottom },
|
|
109
|
+
args: [args],
|
|
110
|
+
includeAnchorArg: false,
|
|
111
|
+
context: gear
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/** Renders a markdown description into a detached element for use in a React `ref`. */
|
|
115
|
+
renderMarkdown(markdown) {
|
|
116
|
+
return this.markdownRenderer.render(new markdown_string_1.MarkdownStringImpl(this.normalizeMarkdown(markdown))).element;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Strips the common leading indentation from a markdown description before rendering.
|
|
120
|
+
*
|
|
121
|
+
* Preference `markdownDescription`s are commonly authored as indented, multi-line JavaScript
|
|
122
|
+
* string literals, which leaves every continuation line prefixed with the source indentation.
|
|
123
|
+
* That accidental indentation makes markdown-it collapse bullet lists and paragraphs into a
|
|
124
|
+
* single dense block, so the description reads as an unstructured run-on. Removing the shared
|
|
125
|
+
* indentation (ignoring the first line, which starts right after the opening quote) restores
|
|
126
|
+
* the intended paragraph and list structure while preserving relative indentation, so nested
|
|
127
|
+
* lists stay nested.
|
|
128
|
+
*/
|
|
129
|
+
normalizeMarkdown(markdown) {
|
|
130
|
+
const lines = markdown.split('\n');
|
|
131
|
+
let common = Number.POSITIVE_INFINITY;
|
|
132
|
+
for (let i = 1; i < lines.length; i++) {
|
|
133
|
+
const line = lines[i];
|
|
134
|
+
if (!line.trim()) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
common = Math.min(common, line.length - line.trimStart().length);
|
|
138
|
+
}
|
|
139
|
+
if (!Number.isFinite(common) || common === 0) {
|
|
140
|
+
return markdown;
|
|
141
|
+
}
|
|
142
|
+
return lines.map((line, index) => (index === 0 ? line : line.slice(common))).join('\n');
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Reads the label and (already-localized) markdown description a preference declares in its registered
|
|
146
|
+
* schema, so settings rows do not have to re-author those strings. Returns `undefined` fields when the
|
|
147
|
+
* preference is unknown.
|
|
148
|
+
*
|
|
149
|
+
* Most AI preferences share the group `title` ("AI Features") to be grouped together in the Settings UI,
|
|
150
|
+
* which also ignores it and derives each setting's name from its id. We mirror that: a genuinely specific
|
|
151
|
+
* `title` is used as-is, but the shared group title falls back to the humanized preference id (e.g.
|
|
152
|
+
* `ai-features.google.apiKey` → "Api Key") so rows show their own name rather than "AI Features".
|
|
153
|
+
*/
|
|
154
|
+
describe(preferenceId) {
|
|
155
|
+
const property = this.schemaService.getSchemaProperty(preferenceId);
|
|
156
|
+
if (!property) {
|
|
157
|
+
return { label: undefined, description: undefined };
|
|
158
|
+
}
|
|
159
|
+
const specificTitle = property.title && property.title !== ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE ? property.title : undefined;
|
|
160
|
+
return {
|
|
161
|
+
label: specificTitle ?? this.formatPreferenceName(preferenceId),
|
|
162
|
+
description: property.markdownDescription ?? property.description
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
/** The schema tags declared for a preference (e.g. `['experimental']`), shown as badges next to the title. */
|
|
166
|
+
tags(preferenceId) {
|
|
167
|
+
return this.schemaService.getSchemaProperty(preferenceId)?.tags ?? [];
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Human-readable name for a preference derived from its id. The `ai-features` root and the area segment
|
|
171
|
+
* (`chat`, `google`, …) are dropped — the category/section already conveys them — and the remaining
|
|
172
|
+
* segments are humanized (camelCase split, first letter upper-cased) and joined with ": ", e.g.
|
|
173
|
+
* `ai-features.chat.tokenUsageIndicator.enabled` → "Token Usage Indicator: Enabled",
|
|
174
|
+
* `ai-features.google.apiKey` → "Api Key".
|
|
175
|
+
*/
|
|
176
|
+
formatPreferenceName(preferenceId) {
|
|
177
|
+
const parts = preferenceId.split('.');
|
|
178
|
+
const segments = parts.length > 2 ? parts.slice(2) : parts.slice(-1);
|
|
179
|
+
return segments.map(segment => this.humanizeSegment(segment)).join(': ');
|
|
180
|
+
}
|
|
181
|
+
humanizeSegment(segment) {
|
|
182
|
+
if (!segment) {
|
|
183
|
+
return segment;
|
|
184
|
+
}
|
|
185
|
+
let formatted = segment[0].toLocaleUpperCase();
|
|
186
|
+
for (let i = 1; i < segment.length; i++) {
|
|
187
|
+
const char = segment[i];
|
|
188
|
+
const previous = segment[i - 1];
|
|
189
|
+
if (this.isUpperCase(char) && !/\s/.test(previous) && !this.isUpperCase(previous)) {
|
|
190
|
+
formatted += ' ';
|
|
191
|
+
}
|
|
192
|
+
formatted += char;
|
|
193
|
+
}
|
|
194
|
+
return formatted.trim();
|
|
195
|
+
}
|
|
196
|
+
isUpperCase(char) {
|
|
197
|
+
return char === char.toLocaleUpperCase() && char.toLocaleLowerCase() !== char.toLocaleUpperCase();
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The human-readable language-model provider name a preference declares in its schema
|
|
201
|
+
* `typeDetails` (as `{ [MODEL_PROVIDER_TYPE_DETAIL]: { label } }`, see {@link ModelProviderTypeDetail}),
|
|
202
|
+
* or `undefined` when none is declared. The Models page uses this to label a provider block without
|
|
203
|
+
* hard-coding provider names.
|
|
204
|
+
*/
|
|
205
|
+
modelProviderLabel(preferenceId) {
|
|
206
|
+
const typeDetails = this.schemaService.getSchemaProperty(preferenceId)?.typeDetails;
|
|
207
|
+
const detail = typeDetails && typeof typeDetails === 'object'
|
|
208
|
+
? typeDetails[ai_core_preferences_1.MODEL_PROVIDER_TYPE_DETAIL]
|
|
209
|
+
: undefined;
|
|
210
|
+
if (detail && typeof detail === 'object') {
|
|
211
|
+
const label = detail.label;
|
|
212
|
+
if (typeof label === 'string') {
|
|
213
|
+
return label;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Whether a preference declares itself part of a language-model provider block, i.e. carries the
|
|
220
|
+
* `aiModelProvider` {@link MODEL_PROVIDER_TYPE_DETAIL} typeDetail (in any form). The Models page uses
|
|
221
|
+
* this positive marker to discover provider blocks, so feature areas that never claim to be a provider
|
|
222
|
+
* are never mistaken for one.
|
|
223
|
+
*/
|
|
224
|
+
isModelProviderPreference(preferenceId) {
|
|
225
|
+
const typeDetails = this.schemaService.getSchemaProperty(preferenceId)?.typeDetails;
|
|
226
|
+
return !!typeDetails && typeof typeDetails === 'object' && ai_core_preferences_1.MODEL_PROVIDER_TYPE_DETAIL in typeDetails;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Builds {@link SelectOption}s from a preference's `enum`, using its `enumItemLabels`
|
|
230
|
+
* (falling back to `enumDescriptions`, then the raw value) for the display label.
|
|
231
|
+
* Returns an empty array when the preference declares no enum.
|
|
232
|
+
*/
|
|
233
|
+
enumOptions(preferenceId) {
|
|
234
|
+
const property = this.schemaService.getSchemaProperty(preferenceId);
|
|
235
|
+
const values = property?.enum;
|
|
236
|
+
if (!values) {
|
|
237
|
+
return [];
|
|
238
|
+
}
|
|
239
|
+
// The label must be the value (or an explicit `enumItemLabels` entry) — never `enumDescriptions`,
|
|
240
|
+
// which is the option's explanatory text and belongs in `description`, not in the label.
|
|
241
|
+
const labels = property?.enumItemLabels;
|
|
242
|
+
const descriptions = property?.enumDescriptions;
|
|
243
|
+
return values.map((value, index) => ({
|
|
244
|
+
value: String(value),
|
|
245
|
+
label: labels?.[index] ?? String(value),
|
|
246
|
+
description: descriptions?.[index]
|
|
247
|
+
}));
|
|
248
|
+
}
|
|
249
|
+
/** All registered preference ids, e.g. to discover a provider's `ai-features.<provider>.*` block. */
|
|
250
|
+
preferenceIds() {
|
|
251
|
+
return Array.from(this.schemaService.getSchemaProperties().keys());
|
|
252
|
+
}
|
|
253
|
+
/** All displayable `ai-features.*` preference ids — every AI setting that should appear somewhere in the view. */
|
|
254
|
+
aiFeaturePreferenceIds() {
|
|
255
|
+
return this.preferenceIds().filter(id => id.startsWith('ai-features.') && this.isDisplayable(id));
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Whether a preference is meant to be surfaced as an editable settings row in the AI Configuration
|
|
259
|
+
* view. Excludes only value-less placeholders (`type: 'null'`), such as the redirect entries that
|
|
260
|
+
* only link to this view. The Settings-UI `hidden` flag is intentionally ignored: the AI
|
|
261
|
+
* Configuration view is the dedicated editor for AI preferences, which are hidden from the Settings
|
|
262
|
+
* UI once the cutover (#316) is in effect but must still be editable here.
|
|
263
|
+
*/
|
|
264
|
+
isDisplayable(preferenceId) {
|
|
265
|
+
const property = this.schemaService.getSchemaProperty(preferenceId);
|
|
266
|
+
if (!property) {
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
return property.type !== 'null';
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Infers a sensible {@link AiSettingsControl} for a preference from its schema `type`
|
|
273
|
+
* (a `select` when it declares an `enum`, a masked text input for secrets/API keys). An `array` of strings
|
|
274
|
+
* gets the inline list editor; more complex values — an `object` or an `array` of objects/other types —
|
|
275
|
+
* cannot be edited meaningfully inline, so they resolve to a `json` control that defers to the
|
|
276
|
+
* `settings.json` file. Falls back to a text input for unknown types.
|
|
277
|
+
*/
|
|
278
|
+
controlFor(preferenceId) {
|
|
279
|
+
const property = this.schemaService.getSchemaProperty(preferenceId);
|
|
280
|
+
if (property?.enum) {
|
|
281
|
+
return { type: 'select', options: this.enumOptions(preferenceId) };
|
|
282
|
+
}
|
|
283
|
+
switch (property?.type) {
|
|
284
|
+
case 'boolean':
|
|
285
|
+
return { type: 'boolean' };
|
|
286
|
+
case 'number':
|
|
287
|
+
return { type: 'number', min: property.minimum, max: property.maximum };
|
|
288
|
+
case 'integer':
|
|
289
|
+
return { type: 'number', integer: true, min: property.minimum, max: property.maximum };
|
|
290
|
+
case 'array':
|
|
291
|
+
return this.isStringArray(property) ? { type: 'array' } : { type: 'json' };
|
|
292
|
+
case 'object':
|
|
293
|
+
return { type: 'json' };
|
|
294
|
+
default:
|
|
295
|
+
return { type: 'string', password: this.isSecret(preferenceId) };
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Whether an `array` preference holds plain string items, so it can be edited with the inline list editor
|
|
300
|
+
* (matching the Settings UI, which only offers its array input for `string[]`); everything else defers to
|
|
301
|
+
* a `json` control.
|
|
302
|
+
*/
|
|
303
|
+
isStringArray(property) {
|
|
304
|
+
const items = property.items;
|
|
305
|
+
const itemSchema = Array.isArray(items) ? items[0] : items;
|
|
306
|
+
return itemSchema?.type === 'string';
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Whether a preference holds a secret (an API key, token or password) that should be masked. There is no
|
|
310
|
+
* schema flag for this, so it is inferred from the id's leaf segment, matching how every AI provider names
|
|
311
|
+
* its key preference (e.g. `ai-features.anthropic.apiKey`).
|
|
312
|
+
*/
|
|
313
|
+
isSecret(preferenceId) {
|
|
314
|
+
const leaf = preferenceId.substring(preferenceId.lastIndexOf('.') + 1).toLowerCase();
|
|
315
|
+
return leaf.endsWith('apikey') || leaf.endsWith('token') || leaf.endsWith('secret') || leaf.endsWith('password');
|
|
316
|
+
}
|
|
317
|
+
toPreferenceScope(scope) {
|
|
318
|
+
switch (scope) {
|
|
319
|
+
case 'user':
|
|
320
|
+
return common_1.PreferenceScope.User;
|
|
321
|
+
case 'workspace':
|
|
322
|
+
return common_1.PreferenceScope.Workspace;
|
|
323
|
+
case 'folder':
|
|
324
|
+
return common_1.PreferenceScope.Folder;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
exports.AiSettingsRowService = AiSettingsRowService;
|
|
329
|
+
tslib_1.__decorate([
|
|
330
|
+
(0, inversify_1.inject)(ai_configuration_service_1.AiConfigurationService),
|
|
331
|
+
tslib_1.__metadata("design:type", Object)
|
|
332
|
+
], AiSettingsRowService.prototype, "aiConfigurationService", void 0);
|
|
333
|
+
tslib_1.__decorate([
|
|
334
|
+
(0, inversify_1.inject)(markdown_renderer_1.MarkdownRenderer),
|
|
335
|
+
tslib_1.__metadata("design:type", Object)
|
|
336
|
+
], AiSettingsRowService.prototype, "markdownRenderer", void 0);
|
|
337
|
+
tslib_1.__decorate([
|
|
338
|
+
(0, inversify_1.inject)(preference_schema_1.PreferenceSchemaService),
|
|
339
|
+
tslib_1.__metadata("design:type", Object)
|
|
340
|
+
], AiSettingsRowService.prototype, "schemaService", void 0);
|
|
341
|
+
tslib_1.__decorate([
|
|
342
|
+
(0, inversify_1.inject)(core_1.CommandService),
|
|
343
|
+
tslib_1.__metadata("design:type", Object)
|
|
344
|
+
], AiSettingsRowService.prototype, "commandService", void 0);
|
|
345
|
+
tslib_1.__decorate([
|
|
346
|
+
(0, inversify_1.inject)(context_menu_renderer_1.ContextMenuRenderer),
|
|
347
|
+
tslib_1.__metadata("design:type", context_menu_renderer_1.ContextMenuRenderer)
|
|
348
|
+
], AiSettingsRowService.prototype, "contextMenuRenderer", void 0);
|
|
349
|
+
exports.AiSettingsRowService = AiSettingsRowService = tslib_1.__decorate([
|
|
350
|
+
(0, inversify_1.injectable)()
|
|
351
|
+
], AiSettingsRowService);
|
|
352
|
+
//# sourceMappingURL=ai-settings-row-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-settings-row-service.js","sourceRoot":"","sources":["../../../../src/browser/ai-configuration/components/ai-settings-row-service.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,sCAAoD;AACpD,yFAAoF;AACpF,mDAAyD;AACzD,4FAAuH;AACvH,oGAAgG;AAChG,2FAA2F;AAC3F,4FAAgI;AAChI,+FAA+F;AAC/F,4DAAkE;AAElE,uFAA+I;AAC/I,iGAA4F;AAiC5F;;;;;;;;;;;GAWG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAmB7B,sIAAsI;IACtI,IAAI,mBAAmB;QACnB,OAAO,IAAI,CAAC,OAAO,KAAK,YAAK,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAChG,CAAC;IAED,O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,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC3D,OAAO,UAAU,EAAE,IAAI,KAAK,QAAQ,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACO,QAAQ,CAAC,YAAoB;QACnC,MAAM,IAAI,GAAG,YAAY,CAAC,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACrF,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACrH,CAAC;IAES,iBAAiB,CAAC,KAA2B;QACnD,QAAQ,KAAK,EAAE,CAAC;YACZ,KAAK,MAAM;gBACP,OAAO,wBAAe,CAAC,IAAI,CAAC;YAChC,KAAK,WAAW;gBACZ,OAAO,wBAAe,CAAC,SAAS,CAAC;YACrC,KAAK,QAAQ;gBACT,OAAO,wBAAe,CAAC,MAAM,CAAC;QACtC,CAAC;IACL,CAAC;CACJ,CAAA;AAvUY,oDAAoB;AAGV;IADlB,IAAA,kBAAM,EAAC,iDAAsB,CAAC;;oEACmC;AAG/C;IADlB,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;8DAC6B;AAGnC;IADlB,IAAA,kBAAM,EAAC,2CAAuB,CAAC;;2DAC0B;AAGvC;IADlB,IAAA,kBAAM,EAAC,qBAAc,CAAC;;4DAC2B;AAG/B;IADlB,IAAA,kBAAM,EAAC,2CAAmB,CAAC;sCACY,2CAAmB;iEAAC;+BAfnD,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CAuUhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-settings-row-service.spec.d.ts","sourceRoot":"","sources":["../../../../src/browser/ai-configuration/components/ai-settings-row-service.spec.ts"],"names":[],"mappings":""}
|