Inline base64 source maps had been checked into tracked src files. This strips those comments from the repository without changing runtime behavior or adding ongoing guardrails, per the requested one-time cleanup scope. Constraint: Keep this change limited to tracked source cleanup only Rejected: Add CI/source verification guard | user requested one-time cleanup only Confidence: high Scope-risk: narrow Reversibility: clean Directive: If these directives reappear, fix the producing transform instead of reintroducing repo-side cleanup code Tested: rg -n "sourceMappingURL" ., bun run smoke, bun run verify:privacy, bun run test:provider, npm run test:provider-recommendation Not-tested: bun run typecheck (repository has many pre-existing unrelated failures)
87 lines
2.6 KiB
TypeScript
87 lines
2.6 KiB
TypeScript
import { c as _c } from "react-compiler-runtime";
|
|
import React from 'react';
|
|
import { logEvent } from 'src/services/analytics/index.js';
|
|
import { Box, Link, Newline, Text } from '../ink.js';
|
|
import { gracefulShutdownSync } from '../utils/gracefulShutdown.js';
|
|
import { updateSettingsForSource } from '../utils/settings/settings.js';
|
|
import { Select } from './CustomSelect/index.js';
|
|
import { Dialog } from './design-system/Dialog.js';
|
|
type Props = {
|
|
onAccept(): void;
|
|
};
|
|
export function BypassPermissionsModeDialog(t0: Props) {
|
|
const $ = _c(7);
|
|
const {
|
|
onAccept
|
|
} = t0;
|
|
let t1: [];
|
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
t1 = [];
|
|
$[0] = t1;
|
|
} else {
|
|
t1 = $[0];
|
|
}
|
|
React.useEffect(_temp, t1);
|
|
let t2;
|
|
if ($[1] !== onAccept) {
|
|
t2 = function onChange(value: 'accept' | 'decline') {
|
|
bb3: switch (value) {
|
|
case "accept":
|
|
{
|
|
logEvent("tengu_bypass_permissions_mode_dialog_accept", {});
|
|
updateSettingsForSource("userSettings", {
|
|
skipDangerousModePermissionPrompt: true
|
|
});
|
|
onAccept();
|
|
break bb3;
|
|
}
|
|
case "decline":
|
|
{
|
|
gracefulShutdownSync(1);
|
|
}
|
|
}
|
|
};
|
|
$[1] = onAccept;
|
|
$[2] = t2;
|
|
} else {
|
|
t2 = $[2];
|
|
}
|
|
const onChange = t2;
|
|
const handleEscape = _temp2;
|
|
let t3;
|
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
t3 = <Box flexDirection="column" gap={1}><Text>In Bypass Permissions mode, Claude Code will not ask for your approval before running potentially dangerous commands.<Newline />This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily be restored if damaged.</Text><Text>By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode.</Text><Link url="https://code.claude.com/docs/en/security" /></Box>;
|
|
$[3] = t3;
|
|
} else {
|
|
t3 = $[3];
|
|
}
|
|
let t4;
|
|
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
t4 = [{
|
|
label: "No, exit",
|
|
value: "decline"
|
|
}, {
|
|
label: "Yes, I accept",
|
|
value: "accept"
|
|
}];
|
|
$[4] = t4;
|
|
} else {
|
|
t4 = $[4];
|
|
}
|
|
let t5;
|
|
if ($[5] !== onChange) {
|
|
t5 = <Dialog title="WARNING: Claude Code running in Bypass Permissions mode" color="error" onCancel={handleEscape}>{t3}<Select options={t4} onChange={(value_0: string) => onChange(value_0 as 'accept' | 'decline')} /></Dialog>;
|
|
$[5] = onChange;
|
|
$[6] = t5;
|
|
} else {
|
|
t5 = $[6];
|
|
}
|
|
return t5;
|
|
}
|
|
function _temp2() {
|
|
gracefulShutdownSync(0);
|
|
}
|
|
function _temp() {
|
|
logEvent("tengu_bypass_permissions_mode_dialog_shown", {});
|
|
}
|