MCPcopy Create free account
hub / github.com/TanStack/ai / pickOption

Function pickOption

packages/ai-acp/src/permissions.ts:14–23  ·  view source on GitHub ↗
(
  request: AcpPermissionRequest,
  kinds: Array<string>,
)

Source from the content-addressed store, hash-verified

12const EDIT_KINDS = new Set(['edit', 'move', 'delete'])
13
14function pickOption(
15 request: AcpPermissionRequest,
16 kinds: Array<string>,
17): AcpPermissionOutcome {
18 for (const kind of kinds) {
19 const option = request.options.find((candidate) => candidate.kind === kind)
20 if (option) return { outcome: 'selected', optionId: option.optionId }
21 }
22 return { outcome: 'cancelled' }
23}
24
25export function resolvePermission(
26 request: AcpPermissionRequest,

Callers 2

allowFunction · 0.85
rejectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected