@@ -39,6 +39,7 @@ import type { ProviderId } from '@/providers/types'
3939import type { ProviderName } from '@/stores/providers'
4040import { getToolMetadata } from '@/tools/metadata'
4141
42+ /** Resolves draft policy and inheritance, checks request support, and stages edits without saving. */
4243export interface PermissionEditorControls {
4344 getState : ( target : AccessRequestTarget ) => PermissionGroupAccessState
4445 isInherited : ( target : AccessRequestTarget ) => boolean
@@ -75,6 +76,7 @@ interface PermissionBulkSelectProps extends PermissionEditorControls {
7576 targets : AccessRequestTarget [ ]
7677}
7778
79+ /** Edits non-inherited targets, offering requests only when every editable target supports them. */
7880export function PermissionBulkSelect ( { targets, ...controls } : PermissionBulkSelectProps ) {
7981 const editable = targets . filter ( ( target ) => ! controls . isInherited ( target ) )
8082 return (
@@ -118,6 +120,7 @@ interface PlatformPermissionRowProps extends PermissionEditorControls {
118120 children ?: ReactNode
119121}
120122
123+ /** Edits a platform feature with optional child controls; inert organization-only rows stay disabled. */
121124export function PlatformPermissionRow ( {
122125 feature,
123126 inert,
@@ -182,6 +185,7 @@ interface PermissionGridProps extends PermissionEditorControls {
182185 emptyLabel : string
183186}
184187
188+ /** Searches items of one target kind and limits bulk edits to the visible, editable rows. */
185189export function PermissionGrid ( {
186190 items,
187191 kind,
@@ -279,6 +283,7 @@ interface ProviderRowProps extends PermissionEditorControls {
279283 workspaceId ?: string
280284}
281285
286+ /** Edits a provider and its inherited model choices, using workspace-scoped dynamic models when needed. */
282287export function ProviderRow ( { providerId, workspaceId, ...controls } : ProviderRowProps ) {
283288 const [ expanded , setExpanded ] = useState ( false )
284289 const definition = PROVIDER_DEFINITIONS [ providerId ]
@@ -341,6 +346,7 @@ interface BlockToolRowProps extends PermissionEditorControls {
341346 block : BlockConfig
342347}
343348
349+ /** Edits a block and its tool operations, preserving child choices while a parent restricts access. */
344350export function BlockToolRow ( { block, ...controls } : BlockToolRowProps ) {
345351 const [ expanded , setExpanded ] = useState ( false )
346352 const childControls = inheritedControls ( { kind : 'integration' , id : block . type } , controls )
0 commit comments