2026-02-18 13:53:03 -06:00
|
|
|
import type { AdapterConfigFieldsProps } from "../types";
|
|
|
|
|
import {
|
|
|
|
|
Field,
|
|
|
|
|
ToggleField,
|
|
|
|
|
DraftInput,
|
|
|
|
|
DraftNumberInput,
|
|
|
|
|
help,
|
|
|
|
|
} from "../../components/agent-config-primitives";
|
|
|
|
|
|
|
|
|
|
const inputClass =
|
|
|
|
|
"w-full rounded-md border border-border px-2.5 py-1.5 bg-transparent outline-none text-sm font-mono placeholder:text-muted-foreground/40";
|
|
|
|
|
|
2026-02-20 12:50:36 -06:00
|
|
|
export function ClaudeLocalConfigFields(_props: AdapterConfigFieldsProps) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function ClaudeLocalAdvancedFields({
|
2026-02-18 13:53:03 -06:00
|
|
|
isCreate,
|
|
|
|
|
values,
|
|
|
|
|
set,
|
|
|
|
|
config,
|
|
|
|
|
eff,
|
|
|
|
|
mark,
|
|
|
|
|
}: AdapterConfigFieldsProps) {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<ToggleField
|
|
|
|
|
label="Skip permissions"
|
|
|
|
|
hint={help.dangerouslySkipPermissions}
|
|
|
|
|
checked={
|
|
|
|
|
isCreate
|
|
|
|
|
? values!.dangerouslySkipPermissions
|
|
|
|
|
: eff(
|
|
|
|
|
"adapterConfig",
|
|
|
|
|
"dangerouslySkipPermissions",
|
|
|
|
|
config.dangerouslySkipPermissions !== false,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
onChange={(v) =>
|
|
|
|
|
isCreate
|
|
|
|
|
? set!({ dangerouslySkipPermissions: v })
|
|
|
|
|
: mark("adapterConfig", "dangerouslySkipPermissions", v)
|
|
|
|
|
}
|
|
|
|
|
/>
|
2026-02-20 12:50:36 -06:00
|
|
|
<Field label="Max turns per run" hint={help.maxTurnsPerRun}>
|
|
|
|
|
{isCreate ? (
|
|
|
|
|
<input
|
|
|
|
|
type="number"
|
|
|
|
|
className={inputClass}
|
|
|
|
|
value={values!.maxTurnsPerRun}
|
|
|
|
|
onChange={(e) => set!({ maxTurnsPerRun: Number(e.target.value) })}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<DraftNumberInput
|
|
|
|
|
value={eff(
|
|
|
|
|
"adapterConfig",
|
|
|
|
|
"maxTurnsPerRun",
|
|
|
|
|
Number(config.maxTurnsPerRun ?? 80),
|
|
|
|
|
)}
|
|
|
|
|
onCommit={(v) => mark("adapterConfig", "maxTurnsPerRun", v || 80)}
|
|
|
|
|
immediate
|
|
|
|
|
className={inputClass}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</Field>
|
2026-02-18 13:53:03 -06:00
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|