@marimo-team/islands 0.23.11-dev13 → 0.23.11-dev18
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/dist/{ConnectedDataExplorerComponent-Z3RP7Vmm.js → ConnectedDataExplorerComponent-BnPKA-xR.js} +4 -4
- package/dist/assets/__vite-browser-external-DAm_YW43.js +1 -0
- package/dist/assets/{worker-CC0Oul9k.js → worker-DEDLIQQV.js} +2 -2
- package/dist/{chat-ui-ZCkzXjpY.js → chat-ui-Bf2NICxi.js} +6 -6
- package/dist/{code-visibility-DCikkwzG.js → code-visibility-BCzDeiYd.js} +8 -8
- package/dist/{formats-C4wO47tk.js → formats-BOYEeoL_.js} +1 -1
- package/dist/{glide-data-editor-BPkCPs7L.js → glide-data-editor-A_l7_PQZ.js} +2 -2
- package/dist/{html-to-image-AwZNbzIe.js → html-to-image-BJbLjZyG.js} +5 -5
- package/dist/{input-OdWHkobi.js → input-Cn-SZdXY.js} +1 -1
- package/dist/main.js +18 -18
- package/dist/{mermaid-BotvIKg9.js → mermaid-Br973nIL.js} +2 -2
- package/dist/{process-output-BnIUIlAz.js → process-output-Dw_ngzH2.js} +1 -1
- package/dist/{reveal-component-BfR2E_0l.js → reveal-component-DchNN1ES.js} +5 -5
- package/dist/{spec-X7FwLJni.js → spec-f8-xgaui.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{toDate-d8RCRrRd.js → toDate-B4-pUFYh.js} +1 -1
- package/dist/{useAsyncData-PonK__yh.js → useAsyncData-B3PfqrwD.js} +1 -1
- package/dist/{useDeepCompareMemoize-D3NGWke6.js → useDeepCompareMemoize-YInAvJP3.js} +1 -1
- package/dist/{useLifecycle-00mO3OSS.js → useLifecycle-B3NOEiY5.js} +1 -1
- package/dist/{useTheme-DEhDzATN.js → useTheme-BPeFKs1Q.js} +2 -1
- package/dist/{vega-component-DGPUhbDs.js → vega-component-CMicMpWX.js} +5 -5
- package/package.json +1 -1
- package/src/components/ai/ai-model-dropdown.tsx +6 -0
- package/src/components/app-config/ai-config.tsx +67 -54
- package/src/components/app-config/data-form.tsx +33 -43
- package/src/components/app-config/is-overridden.tsx +125 -58
- package/src/components/app-config/user-config-form.tsx +178 -227
- package/src/components/chat/chat-panel.tsx +17 -8
- package/src/components/datasources/__tests__/utils.test.ts +127 -2
- package/src/components/datasources/datasources.tsx +44 -17
- package/src/components/datasources/utils.ts +45 -0
- package/src/core/config/config-schema.ts +6 -1
- package/src/css/md.css +12 -0
- package/dist/assets/__vite-browser-external-eshhtsgZ.js +0 -1
|
@@ -6,7 +6,7 @@ import { _ as Logger } from "./button-C5K9fIPF.js";
|
|
|
6
6
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
7
7
|
import { u as createLucideIcon } from "./dist-Dk6PV_d3.js";
|
|
8
8
|
import { r as KnownQueryParams } from "./constants-T20xxyNf.js";
|
|
9
|
-
import { b as atom, d as store, m as isIslands, p as waitFor } from "./useTheme-
|
|
9
|
+
import { b as atom, d as store, m as isIslands, p as waitFor } from "./useTheme-BPeFKs1Q.js";
|
|
10
10
|
import { t as invariant } from "./invariant-wRzNXIsJ.js";
|
|
11
11
|
var CircleQuestionMark = createLucideIcon("circle-question-mark", [
|
|
12
12
|
["circle", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
3
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
4
|
-
import { T as useEvent_default } from "./useTheme-
|
|
4
|
+
import { T as useEvent_default } from "./useTheme-BPeFKs1Q.js";
|
|
5
5
|
import { t as invariant } from "./invariant-wRzNXIsJ.js";
|
|
6
6
|
var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1), Result = {
|
|
7
7
|
error(e, s) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
|
-
import { w as dequal } from "./useTheme-
|
|
3
|
+
import { w as dequal } from "./useTheme-BPeFKs1Q.js";
|
|
4
4
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
5
5
|
function useDeepCompareMemoize(e) {
|
|
6
6
|
let i = import_react.useRef(e);
|
|
@@ -4,7 +4,7 @@ import { t as require_react } from "./react-DA-nE2FX.js";
|
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
5
|
import { u as createLucideIcon } from "./dist-Dk6PV_d3.js";
|
|
6
6
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
7
|
-
import { b as atom, v as useSetAtom } from "./useTheme-
|
|
7
|
+
import { b as atom, v as useSetAtom } from "./useTheme-BPeFKs1Q.js";
|
|
8
8
|
var Calendar = createLucideIcon("calendar", [
|
|
9
9
|
["path", {
|
|
10
10
|
d: "M8 2v4",
|
|
@@ -2,23 +2,23 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
|
2
2
|
import { _ as Logger, c as Objects, g as cn, h as Events } from "./button-C5K9fIPF.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { c as asRemoteURL, v as CircleQuestionMark } from "./toDate-
|
|
5
|
+
import { c as asRemoteURL, v as CircleQuestionMark } from "./toDate-B4-pUFYh.js";
|
|
6
6
|
import "./react-dom-BTJzcVJ9.js";
|
|
7
7
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
8
8
|
import "./zod-aLSua2NL.js";
|
|
9
9
|
import { n as ErrorBanner } from "./error-banner-CJXYJ6Sb.js";
|
|
10
10
|
import { t as Tooltip } from "./tooltip-DpcyNkQ2.js";
|
|
11
11
|
import { i as debounce_default } from "./constants-T20xxyNf.js";
|
|
12
|
-
import { T as useEvent_default, n as useTheme } from "./useTheme-
|
|
12
|
+
import { T as useEvent_default, n as useTheme } from "./useTheme-BPeFKs1Q.js";
|
|
13
13
|
import { s as uniq } from "./arrays-sEtDRoG4.js";
|
|
14
|
-
import { a as isValid, i as AlertTitle, n as Alert, t as arrow } from "./formats-
|
|
14
|
+
import { a as isValid, i as AlertTitle, n as Alert, t as arrow } from "./formats-BOYEeoL_.js";
|
|
15
15
|
import { n as formats } from "./vega-loader.browser-CZ-J8Py3.js";
|
|
16
16
|
import { a as getContainerWidth, n as vegaLoadData, s as tooltipHandler } from "./loader-BWLPpjKK.js";
|
|
17
17
|
import { t as j } from "./react-vega-B0sAlDTL.js";
|
|
18
18
|
import "./defaultLocale-u-3osm0P.js";
|
|
19
19
|
import "./defaultLocale-BoHTsDG6.js";
|
|
20
|
-
import { t as useAsyncData } from "./useAsyncData-
|
|
21
|
-
import { t as useDeepCompareMemoize } from "./useDeepCompareMemoize-
|
|
20
|
+
import { t as useAsyncData } from "./useAsyncData-B3PfqrwD.js";
|
|
21
|
+
import { t as useDeepCompareMemoize } from "./useDeepCompareMemoize-YInAvJP3.js";
|
|
22
22
|
import { t as Semaphore } from "./semaphore-CNDGTzkX.js";
|
|
23
23
|
var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
24
24
|
function fixRelativeUrl(e) {
|
package/package.json
CHANGED
|
@@ -45,6 +45,7 @@ interface AIModelDropdownProps {
|
|
|
45
45
|
showAddCustomModelDocs?: boolean;
|
|
46
46
|
displayIconOnly?: boolean;
|
|
47
47
|
forRole: SupportedRole;
|
|
48
|
+
disabled?: boolean;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
export const AIModelDropdown = ({
|
|
@@ -57,6 +58,7 @@ export const AIModelDropdown = ({
|
|
|
57
58
|
showAddCustomModelDocs = false,
|
|
58
59
|
forRole,
|
|
59
60
|
displayIconOnly = false,
|
|
61
|
+
disabled = false,
|
|
60
62
|
}: AIModelDropdownProps) => {
|
|
61
63
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
62
64
|
|
|
@@ -131,6 +133,9 @@ export const AIModelDropdown = ({
|
|
|
131
133
|
};
|
|
132
134
|
|
|
133
135
|
const handleSelect = (modelId: QualifiedModelId) => {
|
|
136
|
+
if (disabled) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
134
139
|
if (onSelect) {
|
|
135
140
|
onSelect(modelId);
|
|
136
141
|
} else {
|
|
@@ -142,6 +147,7 @@ export const AIModelDropdown = ({
|
|
|
142
147
|
return (
|
|
143
148
|
<DropdownMenu open={isOpen} onOpenChange={setIsOpen}>
|
|
144
149
|
<DropdownMenuTrigger
|
|
150
|
+
disabled={disabled}
|
|
145
151
|
className={`flex items-center justify-between px-2 py-0.5 border rounded-md
|
|
146
152
|
hover:bg-accent hover:text-accent-foreground ${triggerClassName}`}
|
|
147
153
|
>
|
|
@@ -79,7 +79,11 @@ import { Tooltip } from "../ui/tooltip";
|
|
|
79
79
|
import { formItemClasses, SettingSubtitle } from "./common";
|
|
80
80
|
import { AWS_REGIONS } from "./constants";
|
|
81
81
|
import { IncorrectModelId } from "./incorrect-model-id";
|
|
82
|
-
import {
|
|
82
|
+
import {
|
|
83
|
+
IsOverridden,
|
|
84
|
+
OverriddenFormField,
|
|
85
|
+
useConfigOverride,
|
|
86
|
+
} from "./is-overridden";
|
|
83
87
|
import { MCPConfig } from "./mcp-config";
|
|
84
88
|
import { aiSettingsSubTabAtom } from "./state";
|
|
85
89
|
|
|
@@ -123,7 +127,6 @@ interface ApiKeyProps {
|
|
|
123
127
|
|
|
124
128
|
export const ApiKey: React.FC<ApiKeyProps> = ({
|
|
125
129
|
form,
|
|
126
|
-
config,
|
|
127
130
|
name,
|
|
128
131
|
placeholder,
|
|
129
132
|
testId,
|
|
@@ -131,10 +134,10 @@ export const ApiKey: React.FC<ApiKeyProps> = ({
|
|
|
131
134
|
onChange,
|
|
132
135
|
}) => {
|
|
133
136
|
return (
|
|
134
|
-
<
|
|
137
|
+
<OverriddenFormField
|
|
135
138
|
control={form.control}
|
|
136
139
|
name={name}
|
|
137
|
-
render={({ field }) => (
|
|
140
|
+
render={({ field, override }) => (
|
|
138
141
|
<div className="flex flex-col space-y-1">
|
|
139
142
|
<FormItem className={formItemClasses}>
|
|
140
143
|
<FormLabel>API Key</FormLabel>
|
|
@@ -146,7 +149,8 @@ export const ApiKey: React.FC<ApiKeyProps> = ({
|
|
|
146
149
|
placeholder={placeholder}
|
|
147
150
|
type="password"
|
|
148
151
|
{...field}
|
|
149
|
-
value={asStringOrEmpty(
|
|
152
|
+
value={asStringOrEmpty(override.value)}
|
|
153
|
+
disabled={override.isOverridden}
|
|
150
154
|
onChange={(e) => {
|
|
151
155
|
const value = e.target.value;
|
|
152
156
|
if (!value.includes("*")) {
|
|
@@ -157,7 +161,7 @@ export const ApiKey: React.FC<ApiKeyProps> = ({
|
|
|
157
161
|
/>
|
|
158
162
|
</FormControl>
|
|
159
163
|
<FormMessage />
|
|
160
|
-
<IsOverridden
|
|
164
|
+
<IsOverridden override={override} />
|
|
161
165
|
</FormItem>
|
|
162
166
|
{description && <FormDescription>{description}</FormDescription>}
|
|
163
167
|
</div>
|
|
@@ -191,7 +195,6 @@ function asStringOrEmpty<T>(value: T): string {
|
|
|
191
195
|
|
|
192
196
|
export const BaseUrl: React.FC<BaseUrlProps> = ({
|
|
193
197
|
form,
|
|
194
|
-
config,
|
|
195
198
|
name,
|
|
196
199
|
placeholder,
|
|
197
200
|
testId,
|
|
@@ -200,10 +203,10 @@ export const BaseUrl: React.FC<BaseUrlProps> = ({
|
|
|
200
203
|
onChange,
|
|
201
204
|
}) => {
|
|
202
205
|
return (
|
|
203
|
-
<
|
|
206
|
+
<OverriddenFormField
|
|
204
207
|
control={form.control}
|
|
205
208
|
name={name}
|
|
206
|
-
render={({ field }) => (
|
|
209
|
+
render={({ field, override }) => (
|
|
207
210
|
<div className="flex flex-col space-y-1">
|
|
208
211
|
<FormItem className={formItemClasses}>
|
|
209
212
|
<FormLabel>Base URL</FormLabel>
|
|
@@ -214,8 +217,8 @@ export const BaseUrl: React.FC<BaseUrlProps> = ({
|
|
|
214
217
|
className="m-0 inline-flex h-7"
|
|
215
218
|
placeholder={placeholder}
|
|
216
219
|
{...field}
|
|
217
|
-
value={asStringOrEmpty(
|
|
218
|
-
disabled={disabled}
|
|
220
|
+
value={asStringOrEmpty(override.value)}
|
|
221
|
+
disabled={disabled || override.isOverridden}
|
|
219
222
|
onChange={(e) => {
|
|
220
223
|
field.onChange(e.target.value);
|
|
221
224
|
onChange?.(e.target.value);
|
|
@@ -223,7 +226,7 @@ export const BaseUrl: React.FC<BaseUrlProps> = ({
|
|
|
223
226
|
/>
|
|
224
227
|
</FormControl>
|
|
225
228
|
<FormMessage />
|
|
226
|
-
<IsOverridden
|
|
229
|
+
<IsOverridden override={override} />
|
|
227
230
|
</FormItem>
|
|
228
231
|
{description && <FormDescription>{description}</FormDescription>}
|
|
229
232
|
</div>
|
|
@@ -245,7 +248,6 @@ interface ModelSelectorProps {
|
|
|
245
248
|
|
|
246
249
|
export const ModelSelector: React.FC<ModelSelectorProps> = ({
|
|
247
250
|
form,
|
|
248
|
-
config,
|
|
249
251
|
name,
|
|
250
252
|
placeholder,
|
|
251
253
|
description,
|
|
@@ -254,11 +256,12 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
|
|
|
254
256
|
onSubmit,
|
|
255
257
|
}) => {
|
|
256
258
|
return (
|
|
257
|
-
<
|
|
259
|
+
<OverriddenFormField
|
|
258
260
|
control={form.control}
|
|
259
261
|
name={name}
|
|
260
|
-
render={({ field }) => {
|
|
261
|
-
const value = asStringOrEmpty(
|
|
262
|
+
render={({ field, override }) => {
|
|
263
|
+
const value = asStringOrEmpty(override.value);
|
|
264
|
+
const overridden = override.isOverridden;
|
|
262
265
|
|
|
263
266
|
const selectModel = (modelId: QualifiedModelId) => {
|
|
264
267
|
field.onChange(modelId);
|
|
@@ -274,6 +277,7 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
|
|
|
274
277
|
value={value}
|
|
275
278
|
placeholder={placeholder}
|
|
276
279
|
onSelect={selectModel}
|
|
280
|
+
disabled={overridden}
|
|
277
281
|
triggerClassName="text-sm"
|
|
278
282
|
customDropdownContent={
|
|
279
283
|
<>
|
|
@@ -289,7 +293,8 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
|
|
|
289
293
|
className="w-full border-border shadow-none focus-visible:shadow-xs"
|
|
290
294
|
placeholder={placeholder}
|
|
291
295
|
{...field}
|
|
292
|
-
value={
|
|
296
|
+
value={value}
|
|
297
|
+
disabled={overridden}
|
|
293
298
|
onKeyDown={Events.stopPropagation()}
|
|
294
299
|
/>
|
|
295
300
|
{value && (
|
|
@@ -311,7 +316,7 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
|
|
|
311
316
|
return (
|
|
312
317
|
<div className="flex flex-col space-y-1">
|
|
313
318
|
{renderFormItem()}
|
|
314
|
-
<IsOverridden
|
|
319
|
+
<IsOverridden override={override} />
|
|
315
320
|
<IncorrectModelId value={value} />
|
|
316
321
|
{description && <FormDescription>{description}</FormDescription>}
|
|
317
322
|
</div>
|
|
@@ -332,17 +337,16 @@ interface ProviderSelectProps {
|
|
|
332
337
|
|
|
333
338
|
export const ProviderSelect: React.FC<ProviderSelectProps> = ({
|
|
334
339
|
form,
|
|
335
|
-
config,
|
|
336
340
|
name,
|
|
337
341
|
options,
|
|
338
342
|
testId,
|
|
339
343
|
disabled = false,
|
|
340
344
|
}) => {
|
|
341
345
|
return (
|
|
342
|
-
<
|
|
346
|
+
<OverriddenFormField
|
|
343
347
|
control={form.control}
|
|
344
348
|
name={name}
|
|
345
|
-
render={({ field }) => (
|
|
349
|
+
render={({ field, override }) => (
|
|
346
350
|
<div className="flex flex-col space-y-1">
|
|
347
351
|
<FormItem className={formItemClasses}>
|
|
348
352
|
<FormLabel>Provider</FormLabel>
|
|
@@ -357,13 +361,13 @@ export const ProviderSelect: React.FC<ProviderSelectProps> = ({
|
|
|
357
361
|
}
|
|
358
362
|
}}
|
|
359
363
|
value={asStringOrEmpty(
|
|
360
|
-
|
|
364
|
+
override.value === true
|
|
361
365
|
? "github"
|
|
362
|
-
:
|
|
366
|
+
: override.value === false
|
|
363
367
|
? "none"
|
|
364
|
-
:
|
|
368
|
+
: override.value,
|
|
365
369
|
)}
|
|
366
|
-
disabled={disabled}
|
|
370
|
+
disabled={disabled || override.isOverridden}
|
|
367
371
|
className="inline-flex mr-2"
|
|
368
372
|
>
|
|
369
373
|
{options.map((option) => (
|
|
@@ -374,7 +378,7 @@ export const ProviderSelect: React.FC<ProviderSelectProps> = ({
|
|
|
374
378
|
</NativeSelect>
|
|
375
379
|
</FormControl>
|
|
376
380
|
<FormMessage />
|
|
377
|
-
<IsOverridden
|
|
381
|
+
<IsOverridden override={override} />
|
|
378
382
|
</FormItem>
|
|
379
383
|
</div>
|
|
380
384
|
)}
|
|
@@ -386,12 +390,13 @@ const renderCopilotProvider = ({
|
|
|
386
390
|
form,
|
|
387
391
|
config,
|
|
388
392
|
onSubmit,
|
|
393
|
+
copilot,
|
|
389
394
|
}: {
|
|
390
395
|
form: UseFormReturn<UserConfig>;
|
|
391
396
|
config: UserConfig;
|
|
392
397
|
onSubmit: (values: UserConfig) => void;
|
|
398
|
+
copilot: UserConfig["completion"]["copilot"];
|
|
393
399
|
}) => {
|
|
394
|
-
const copilot = form.getValues("completion.copilot");
|
|
395
400
|
if (copilot === false) {
|
|
396
401
|
return null;
|
|
397
402
|
}
|
|
@@ -535,6 +540,15 @@ export const AiCodeCompletionConfig: React.FC<AiConfigProps> = ({
|
|
|
535
540
|
config,
|
|
536
541
|
onSubmit,
|
|
537
542
|
}) => {
|
|
543
|
+
const getOverride = useConfigOverride();
|
|
544
|
+
// Watch (not `getValues`) so the sub-form re-renders when the provider
|
|
545
|
+
// changes, then resolve the effective value so an overridden
|
|
546
|
+
// `completion.copilot` shows the matching sub-form (not the user's saved one).
|
|
547
|
+
const watchedCopilot = useWatch({
|
|
548
|
+
control: form.control,
|
|
549
|
+
name: "completion.copilot",
|
|
550
|
+
});
|
|
551
|
+
const { value: copilot } = getOverride("completion.copilot", watchedCopilot);
|
|
538
552
|
return (
|
|
539
553
|
<SettingGroup>
|
|
540
554
|
<SettingSubtitle>Code Completion</SettingSubtitle>
|
|
@@ -551,7 +565,7 @@ export const AiCodeCompletionConfig: React.FC<AiConfigProps> = ({
|
|
|
551
565
|
testId="copilot-select"
|
|
552
566
|
/>
|
|
553
567
|
|
|
554
|
-
{renderCopilotProvider({ form, config, onSubmit })}
|
|
568
|
+
{renderCopilotProvider({ form, config, onSubmit, copilot })}
|
|
555
569
|
</SettingGroup>
|
|
556
570
|
);
|
|
557
571
|
};
|
|
@@ -1134,11 +1148,11 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
|
|
|
1134
1148
|
for more details.
|
|
1135
1149
|
</p>
|
|
1136
1150
|
|
|
1137
|
-
<
|
|
1151
|
+
<OverriddenFormField
|
|
1138
1152
|
control={form.control}
|
|
1139
1153
|
disabled={isWasmRuntime}
|
|
1140
1154
|
name="ai.bedrock.region_name"
|
|
1141
|
-
render={({ field }) => (
|
|
1155
|
+
render={({ field, override }) => (
|
|
1142
1156
|
<div className="flex flex-col space-y-1">
|
|
1143
1157
|
<FormItem className={formItemClasses}>
|
|
1144
1158
|
<FormLabel>AWS Region</FormLabel>
|
|
@@ -1147,11 +1161,11 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
|
|
|
1147
1161
|
data-testid="bedrock-region-select"
|
|
1148
1162
|
onChange={(e) => field.onChange(e.target.value)}
|
|
1149
1163
|
value={
|
|
1150
|
-
typeof
|
|
1151
|
-
?
|
|
1164
|
+
typeof override.value === "string"
|
|
1165
|
+
? override.value
|
|
1152
1166
|
: "us-east-1"
|
|
1153
1167
|
}
|
|
1154
|
-
disabled={field.disabled}
|
|
1168
|
+
disabled={field.disabled || override.isOverridden}
|
|
1155
1169
|
className="inline-flex mr-2"
|
|
1156
1170
|
>
|
|
1157
1171
|
{AWS_REGIONS.map((option) => (
|
|
@@ -1162,10 +1176,7 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
|
|
|
1162
1176
|
</NativeSelect>
|
|
1163
1177
|
</FormControl>
|
|
1164
1178
|
<FormMessage />
|
|
1165
|
-
<IsOverridden
|
|
1166
|
-
userConfig={config}
|
|
1167
|
-
name="ai.bedrock.region_name"
|
|
1168
|
-
/>
|
|
1179
|
+
<IsOverridden override={override} />
|
|
1169
1180
|
</FormItem>
|
|
1170
1181
|
<FormDescription>
|
|
1171
1182
|
The AWS region where Bedrock service is available.
|
|
@@ -1174,11 +1185,11 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
|
|
|
1174
1185
|
)}
|
|
1175
1186
|
/>
|
|
1176
1187
|
|
|
1177
|
-
<
|
|
1188
|
+
<OverriddenFormField
|
|
1178
1189
|
control={form.control}
|
|
1179
1190
|
disabled={isWasmRuntime}
|
|
1180
1191
|
name="ai.bedrock.profile_name"
|
|
1181
|
-
render={({ field }) => (
|
|
1192
|
+
render={({ field, override }) => (
|
|
1182
1193
|
<div className="flex flex-col space-y-1">
|
|
1183
1194
|
<FormItem className={formItemClasses}>
|
|
1184
1195
|
<FormLabel>AWS Profile Name (Optional)</FormLabel>
|
|
@@ -1189,14 +1200,12 @@ export const AiProvidersConfig: React.FC<AiConfigProps> = ({
|
|
|
1189
1200
|
className="m-0 inline-flex h-7"
|
|
1190
1201
|
placeholder="default"
|
|
1191
1202
|
{...field}
|
|
1192
|
-
value={
|
|
1203
|
+
value={override.value || ""}
|
|
1204
|
+
disabled={field.disabled || override.isOverridden}
|
|
1193
1205
|
/>
|
|
1194
1206
|
</FormControl>
|
|
1195
1207
|
<FormMessage />
|
|
1196
|
-
<IsOverridden
|
|
1197
|
-
userConfig={config}
|
|
1198
|
-
name="ai.bedrock.profile_name"
|
|
1199
|
-
/>
|
|
1208
|
+
<IsOverridden override={override} />
|
|
1200
1209
|
</FormItem>
|
|
1201
1210
|
<FormDescription>
|
|
1202
1211
|
The AWS profile name from your ~/.aws/credentials file. Leave
|
|
@@ -1380,10 +1389,10 @@ export const AiAssistConfig: React.FC<AiConfigProps> = ({
|
|
|
1380
1389
|
onSubmit={onSubmit}
|
|
1381
1390
|
/>
|
|
1382
1391
|
|
|
1383
|
-
<
|
|
1392
|
+
<OverriddenFormField
|
|
1384
1393
|
control={form.control}
|
|
1385
1394
|
name="ai.rules"
|
|
1386
|
-
render={({ field }) => (
|
|
1395
|
+
render={({ field, override }) => (
|
|
1387
1396
|
<div className="flex flex-col">
|
|
1388
1397
|
<FormItem>
|
|
1389
1398
|
<FormLabel>Custom Rules</FormLabel>
|
|
@@ -1393,11 +1402,12 @@ export const AiAssistConfig: React.FC<AiConfigProps> = ({
|
|
|
1393
1402
|
className="m-0 inline-flex w-full h-32 p-2 text-sm"
|
|
1394
1403
|
placeholder="e.g. Always use type hints; prefer polars over pandas"
|
|
1395
1404
|
{...field}
|
|
1396
|
-
value={
|
|
1405
|
+
value={override.value}
|
|
1406
|
+
disabled={override.isOverridden}
|
|
1397
1407
|
/>
|
|
1398
1408
|
</FormControl>
|
|
1399
1409
|
<FormMessage />
|
|
1400
|
-
<IsOverridden
|
|
1410
|
+
<IsOverridden override={override} />
|
|
1401
1411
|
</FormItem>
|
|
1402
1412
|
<FormDescription>
|
|
1403
1413
|
Custom rules to include in all AI completion prompts.
|
|
@@ -1849,26 +1859,27 @@ export type AiSettingsSubTab =
|
|
|
1849
1859
|
| "ai-models"
|
|
1850
1860
|
| "mcp";
|
|
1851
1861
|
|
|
1852
|
-
const AiEnabledConfig: React.FC<AiConfigProps> = ({ form
|
|
1862
|
+
const AiEnabledConfig: React.FC<AiConfigProps> = ({ form }) => {
|
|
1853
1863
|
return (
|
|
1854
1864
|
<SettingGroup>
|
|
1855
|
-
<
|
|
1865
|
+
<OverriddenFormField
|
|
1856
1866
|
control={form.control}
|
|
1857
1867
|
name="ai.enabled"
|
|
1858
|
-
render={({ field }) => (
|
|
1868
|
+
render={({ field, override }) => (
|
|
1859
1869
|
<div className="flex flex-col gap-y-1">
|
|
1860
1870
|
<FormItem className={formItemClasses}>
|
|
1861
1871
|
<FormLabel className="font-normal">Enable AI features</FormLabel>
|
|
1862
1872
|
<FormControl>
|
|
1863
1873
|
<Checkbox
|
|
1864
1874
|
data-testid="ai-enabled-checkbox"
|
|
1865
|
-
checked={
|
|
1875
|
+
checked={override.value !== false}
|
|
1876
|
+
disabled={override.isOverridden}
|
|
1866
1877
|
onCheckedChange={(checked) =>
|
|
1867
1878
|
field.onChange(checked === true)
|
|
1868
1879
|
}
|
|
1869
1880
|
/>
|
|
1870
1881
|
</FormControl>
|
|
1871
|
-
<IsOverridden
|
|
1882
|
+
<IsOverridden override={override} />
|
|
1872
1883
|
</FormItem>
|
|
1873
1884
|
<FormDescription>
|
|
1874
1885
|
When disabled, AI actions and panels are hidden from the marimo
|
|
@@ -1889,10 +1900,12 @@ export const AiConfig: React.FC<AiConfigProps> = ({
|
|
|
1889
1900
|
// MCP is not supported in WASM
|
|
1890
1901
|
const wasm = isWasm();
|
|
1891
1902
|
const [activeTab, setActiveTab] = useAtom(aiSettingsSubTabAtom);
|
|
1892
|
-
const
|
|
1903
|
+
const getOverride = useConfigOverride();
|
|
1904
|
+
const watchedAiEnabled = useWatch({
|
|
1893
1905
|
control: form.control,
|
|
1894
1906
|
name: "ai.enabled",
|
|
1895
1907
|
});
|
|
1908
|
+
const { value: aiEnabled } = getOverride("ai.enabled", watchedAiEnabled);
|
|
1896
1909
|
const activeVisibleTab =
|
|
1897
1910
|
aiEnabled === false && activeTab !== "ai-features"
|
|
1898
1911
|
? "ai-features"
|