utils.ts
components/permissions/utils.ts
26
Lines
660
Bytes
1
Exports
3
Imports
10
Keywords
What this is
This page documents one file from the repository and includes its full source so you can read it without leaving the docs site.
Beginner explanation
This file is one piece of the larger system. Its name, directory, imports, and exports show where it fits. Start by reading the exports and related files first.
How it is used
Start from the exports list and related files. Those are the easiest clues for where this file fits into the system.
Expert explanation
Architecturally, this file intersects with shell-safety, permissions, ui-flow. It contains 26 lines, 3 detected imports, and 1 detected exports.
Important relationships
- components/permissions/FallbackPermissionRequest.tsx
- components/permissions/PermissionDecisionDebugInfo.tsx
- components/permissions/PermissionDialog.tsx
- components/permissions/PermissionExplanation.tsx
- components/permissions/PermissionPrompt.tsx
- components/permissions/PermissionRequest.tsx
- components/permissions/PermissionRequestTitle.tsx
- components/permissions/PermissionRuleExplanation.tsx
- components/ManagedSettingsSecurityDialog/utils.ts
- components/PromptInput/utils.ts
- components/Spinner/utils.ts
- components/TrustDialog/utils.ts
Detected exports
logUnaryPermissionEvent
Keywords
hasfeedbackgethostplatformforanalyticsutilscompletiontypelogunaryeventtooluseconfirmcompletion_typemessage_ideventvoid
Detected imports
../../utils/env.js../../utils/unaryLogging.js./PermissionRequest.js
Source notes
This page embeds the full file contents. Small or leaf files are still indexed honestly instead of being over-explained.
Full source
import { getHostPlatformForAnalytics } from '../../utils/env.js'
import { type CompletionType, logUnaryEvent } from '../../utils/unaryLogging.js'
import type { ToolUseConfirm } from './PermissionRequest.js'
export function logUnaryPermissionEvent(
completion_type: CompletionType,
{
assistantMessage: {
message: { id: message_id },
},
}: ToolUseConfirm,
event: 'accept' | 'reject',
hasFeedback?: boolean,
): void {
void logUnaryEvent({
completion_type,
event,
metadata: {
language_name: 'none',
message_id,
platform: getHostPlatformForAnalytics(),
hasFeedback: hasFeedback ?? false,
},
})
}