bingocode 1.1.144 → 1.1.145
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +23 -1
- package/package.json +1 -1
- package/scripts/build-auto-mode.ts +86 -0
- package/src/cli/print.ts +3 -3
- package/src/cli/structuredIO.ts +2 -2
- package/src/commands/login/login.tsx +2 -2
- package/src/components/PromptInput/PromptInput.tsx +7 -7
- package/src/components/Settings/Config.tsx +6 -6
- package/src/components/messages/UserToolResultMessage/UserToolSuccessMessage.tsx +3 -3
- package/src/components/permissions/BashPermissionRequest/BashPermissionRequest.tsx +10 -10
- package/src/components/permissions/ExitPlanModePermissionRequest/ExitPlanModePermissionRequest.tsx +10 -10
- package/src/components/permissions/PermissionDecisionDebugInfo.tsx +2 -2
- package/src/components/permissions/PermissionRuleExplanation.tsx +2 -2
- package/src/components/permissions/hooks.ts +2 -2
- package/src/constants/betas.ts +2 -2
- package/src/hooks/notifs/useAutoModeUnavailableNotification.ts +2 -2
- package/src/hooks/toolPermission/PermissionContext.ts +3 -3
- package/src/hooks/toolPermission/handlers/coordinatorHandler.ts +2 -2
- package/src/hooks/toolPermission/handlers/interactiveHandler.ts +6 -6
- package/src/hooks/toolPermission/handlers/swarmWorkerHandler.ts +2 -2
- package/src/hooks/toolPermission/permissionLogging.ts +3 -3
- package/src/hooks/useReplBridge.tsx +2 -2
- package/src/interactiveHelpers.tsx +2 -2
- package/src/main.tsx +8 -8
- package/src/migrations/resetAutoModeOptInForDefaultOffer.ts +2 -2
- package/src/screens/REPL.tsx +4 -4
- package/src/services/api/claude.ts +4 -4
- package/src/services/api/withRetry.ts +2 -2
- package/src/services/tools/toolExecution.ts +2 -2
- package/src/tools/AgentTool/AgentTool.tsx +3 -3
- package/src/tools/AgentTool/agentToolUtils.ts +3 -3
- package/src/tools/AgentTool/runAgent.ts +2 -2
- package/src/tools/BashTool/bashPermissions.ts +17 -17
- package/src/tools/BashTool/pathValidation.ts +2 -2
- package/src/tools/ConfigTool/supportedSettings.ts +2 -2
- package/src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts +5 -5
- package/src/tools/NotebookEditTool/NotebookEditTool.ts +2 -2
- package/src/types/permissions.ts +2 -2
- package/src/utils/attachments.ts +3 -3
- package/src/utils/autoModeDenials.ts +2 -2
- package/src/utils/betas.ts +2 -2
- package/src/utils/classifierApprovals.ts +7 -7
- package/src/utils/messages.ts +2 -2
- package/src/utils/permissions/PermissionMode.ts +2 -2
- package/src/utils/permissions/autoModeState.ts +2 -2
- package/src/utils/permissions/bypassPermissionsKillswitch.ts +2 -2
- package/src/utils/permissions/getNextPermissionMode.ts +2 -2
- package/src/utils/permissions/permissionSetup.ts +13 -13
- package/src/utils/permissions/permissions.ts +6 -6
- package/src/utils/permissions/yoloClassifier.ts +5 -5
- package/src/utils/settings/settings.ts +5 -5
- package/src/utils/settings/types.ts +4 -4
- package/src/utils/swarm/inProcessRunner.ts +2 -2
- package/src/utils/toolResultStorage.ts +2 -2
|
@@ -11,7 +11,29 @@
|
|
|
11
11
|
"WebFetch(domain:www.anthropic.com)",
|
|
12
12
|
"Bash(grep -v \"node_modules\\\\|bun:\\\\|bun/\\\\|bun@\\\\|\\\\.bun\\\\|bunfig\\\\|bundl\\\\|bunny\\\\|abun\\\\|debug\\\\|comment\\\\|//.*bun\\\\|bunta\\\\|buno\")",
|
|
13
13
|
"Bash(grep:*)",
|
|
14
|
-
"Bash(node:*)"
|
|
14
|
+
"Bash(node:*)",
|
|
15
|
+
"WebFetch(domain:www.npmjs.com)",
|
|
16
|
+
"WebFetch(domain:raw.githubusercontent.com)",
|
|
17
|
+
"WebFetch(domain:anthropic.com)",
|
|
18
|
+
"WebFetch(domain:unpkg.com)",
|
|
19
|
+
"WebFetch(domain:registry.npmjs.org)",
|
|
20
|
+
"Bash(npm info:*)",
|
|
21
|
+
"Bash(cd /tmp)",
|
|
22
|
+
"Bash(npm pack:*)",
|
|
23
|
+
"Bash(ls -lh *.tgz)",
|
|
24
|
+
"Bash(tar xzf:*)",
|
|
25
|
+
"Bash(mkdir -p /tmp/old-pkg)",
|
|
26
|
+
"Read(//tmp/old-pkg/**)",
|
|
27
|
+
"Bash(mkdir -p /tmp/old-v1)",
|
|
28
|
+
"Bash(/dev/null ls:*)",
|
|
29
|
+
"Bash(find F:LeanchyVirtuosAgentBingoCode -maxdepth 3 -type f -name *.ts -o -name *.js -o -name *.json)",
|
|
30
|
+
"Bash(find F:LeanchyVirtuosAgentBingoCodesrc -name yoloClassifier* -o -name *yolo*)",
|
|
31
|
+
"Bash(bun --print \"import {feature} from ''bun:bundle''; console.log\\(feature\\(''TRANSCRIPT_CLASSIFIER''\\)\\)\")",
|
|
32
|
+
"Bash(bun:*)",
|
|
33
|
+
"Bash(find F:LeanchyVirtuosAgentBingoCode -name *.plugin.* -o -name *plugin.ts)",
|
|
34
|
+
"Bash(find F:LeanchyVirtuosAgentBingoCodesrc -name globalConfig* -o -name *.globalConfig*)",
|
|
35
|
+
"Read(//f/Leanchy/VirtuosAgent/BingoCode/**)",
|
|
36
|
+
"Bash(python -c \"import json,sys; d=json.load\\(sys.stdin\\); print\\(list\\(d.keys\\(\\)\\)[:20]\\)\")"
|
|
15
37
|
]
|
|
16
38
|
}
|
|
17
39
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* 构建启用 Auto Mode (TRANSCRIPT_CLASSIFIER) 的 BingoCode 发行版本。
|
|
4
|
+
*
|
|
5
|
+
* 原理:
|
|
6
|
+
* - bun:bundle 的 feature() 是编译期宏,运行时永远返回 false。
|
|
7
|
+
* - 通过 Bun.build({ features: [...] }) 将 TRANSCRIPT_CLASSIFIER 内联为 true,
|
|
8
|
+
* dead-code elimination 后所有 auto mode 分支得以保留。
|
|
9
|
+
*
|
|
10
|
+
* 用法:
|
|
11
|
+
* bun run scripts/build-auto-mode.ts
|
|
12
|
+
* bun run scripts/build-auto-mode.ts --watch # 监听源码变化自动重建
|
|
13
|
+
*
|
|
14
|
+
* 构建产物写入 dist/,bin/ 里的启动器会优先使用 dist/ 内的文件。
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { join, relative } from 'path'
|
|
18
|
+
import { existsSync, mkdirSync } from 'fs'
|
|
19
|
+
|
|
20
|
+
const ROOT = join(import.meta.dir, '..')
|
|
21
|
+
const DIST = join(ROOT, 'dist')
|
|
22
|
+
const FEATURES: string[] = ['TRANSCRIPT_CLASSIFIER', 'BASH_CLASSIFIER']
|
|
23
|
+
|
|
24
|
+
const ENTRYPOINTS = [
|
|
25
|
+
{ name: 'cli', src: join(ROOT, 'src', 'entrypoints', 'cli.tsx') },
|
|
26
|
+
{ name: 'manager', src: join(ROOT, 'src', 'entrypoints', 'manager.tsx') },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
if (!existsSync(DIST)) mkdirSync(DIST, { recursive: true })
|
|
30
|
+
|
|
31
|
+
async function build(): Promise<boolean> {
|
|
32
|
+
const start = Date.now()
|
|
33
|
+
process.stdout.write(`[auto-mode] building with features: ${FEATURES.join(', ')}…\n`)
|
|
34
|
+
|
|
35
|
+
const result = await Bun.build({
|
|
36
|
+
entrypoints: ENTRYPOINTS.map(e => e.src),
|
|
37
|
+
outdir: DIST,
|
|
38
|
+
target: 'bun',
|
|
39
|
+
packages: 'external', // node_modules 不打包,保留 require()
|
|
40
|
+
sourcemap: 'none',
|
|
41
|
+
minify: false, // 保留可读性,方便调试
|
|
42
|
+
// @ts-ignore — Bun type defs lag behind actual API
|
|
43
|
+
features: FEATURES,
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const elapsed = Date.now() - start
|
|
47
|
+
|
|
48
|
+
if (!result.success) {
|
|
49
|
+
process.stderr.write(`[auto-mode] build FAILED (${elapsed}ms)\n`)
|
|
50
|
+
for (const log of result.logs) {
|
|
51
|
+
process.stderr.write(` ${log.level}: ${log.message}\n`)
|
|
52
|
+
}
|
|
53
|
+
return false
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
for (const out of result.outputs) {
|
|
57
|
+
process.stdout.write(` ✓ ${relative(ROOT, out.path)} (${(out.size / 1024).toFixed(1)} kB)\n`)
|
|
58
|
+
}
|
|
59
|
+
process.stdout.write(`[auto-mode] build OK in ${elapsed}ms\n`)
|
|
60
|
+
return true
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ── Watch mode ────────────────────────────────────────────────────────────────
|
|
64
|
+
const isWatch = process.argv.includes('--watch')
|
|
65
|
+
|
|
66
|
+
if (isWatch) {
|
|
67
|
+
const { watch } = await import('fs')
|
|
68
|
+
process.stdout.write('[auto-mode] watch mode — rebuilding on src/ changes\n')
|
|
69
|
+
|
|
70
|
+
let debounce: ReturnType<typeof setTimeout> | null = null
|
|
71
|
+
watch(join(ROOT, 'src'), { recursive: true }, (_event, filename) => {
|
|
72
|
+
if (!filename?.match(/\.(ts|tsx)$/)) return
|
|
73
|
+
if (debounce) clearTimeout(debounce)
|
|
74
|
+
debounce = setTimeout(async () => {
|
|
75
|
+
process.stdout.write(`\n[auto-mode] change: ${filename}\n`)
|
|
76
|
+
await build()
|
|
77
|
+
}, 300)
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
// Initial build
|
|
81
|
+
const ok = await build()
|
|
82
|
+
if (!ok) process.exit(1)
|
|
83
|
+
} else {
|
|
84
|
+
const ok = await build()
|
|
85
|
+
process.exit(ok ? 0 : 1)
|
|
86
|
+
}
|
package/src/cli/print.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// biome-ignore-all assist/source/organizeImports: ANT-ONLY import markers must not be reordered
|
|
1
|
+
// biome-ignore-all assist/source/organizeImports: ANT-ONLY import markers must not be reordered
|
|
2
2
|
import { feature } from 'bun:bundle'
|
|
3
3
|
import { readFile, stat } from 'fs/promises'
|
|
4
4
|
import { dirname } from 'path'
|
|
@@ -1064,7 +1064,7 @@ function runHeadlessStreaming(
|
|
|
1064
1064
|
newMode === 'acceptEdits' ||
|
|
1065
1065
|
newMode === 'bypassPermissions' ||
|
|
1066
1066
|
newMode === 'plan' ||
|
|
1067
|
-
newMode === (
|
|
1067
|
+
newMode === (true && 'auto') ||
|
|
1068
1068
|
newMode === 'dontAsk'
|
|
1069
1069
|
) {
|
|
1070
1070
|
output.enqueue({
|
|
@@ -4601,7 +4601,7 @@ function handleSetPermissionMode(
|
|
|
4601
4601
|
|
|
4602
4602
|
// Check if trying to switch to auto mode without the classifier gate
|
|
4603
4603
|
if (
|
|
4604
|
-
|
|
4604
|
+
true &&
|
|
4605
4605
|
request.mode === 'auto' &&
|
|
4606
4606
|
!isAutoModeGateEnabled()
|
|
4607
4607
|
) {
|
package/src/cli/structuredIO.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle'
|
|
1
|
+
import { feature } from 'bun:bundle'
|
|
2
2
|
import type {
|
|
3
3
|
ElicitResult,
|
|
4
4
|
JSONRPCMessage,
|
|
@@ -69,7 +69,7 @@ function serializeDecisionReason(
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
if (
|
|
72
|
-
(
|
|
72
|
+
(true || true) &&
|
|
73
73
|
reason.type === 'classifier'
|
|
74
74
|
) {
|
|
75
75
|
return reason.reason
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { feature } from 'bun:bundle';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { resetCostState } from '../../bootstrap/state.js';
|
|
@@ -44,7 +44,7 @@ export async function call(onDone: LocalJSXCommandOnDone, context: LocalJSXComma
|
|
|
44
44
|
resetBypassPermissionsCheck();
|
|
45
45
|
const appState = context.getAppState();
|
|
46
46
|
void checkAndDisableBypassPermissionsIfNeeded(appState.toolPermissionContext, context.setAppState);
|
|
47
|
-
if (
|
|
47
|
+
if (true) {
|
|
48
48
|
resetAutoModeGateCheck();
|
|
49
49
|
void checkAndDisableAutoModeIfNeeded(appState.toolPermissionContext, context.setAppState, appState.fastMode);
|
|
50
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle';
|
|
1
|
+
import { feature } from 'bun:bundle';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -1452,10 +1452,10 @@ function PromptInput({
|
|
|
1452
1452
|
// the warning dialog once — the CLI flag should grant carousel access,
|
|
1453
1453
|
// not bypass the safety text.
|
|
1454
1454
|
let isEnteringAutoModeFirstTime = false;
|
|
1455
|
-
if (
|
|
1455
|
+
if (true) {
|
|
1456
1456
|
isEnteringAutoModeFirstTime = nextMode === 'auto' && toolPermissionContext.mode !== 'auto' && !hasAutoModeOptIn() && !viewingAgentTaskId; // Only show for primary agent, not subagents
|
|
1457
1457
|
}
|
|
1458
|
-
if (
|
|
1458
|
+
if (true) {
|
|
1459
1459
|
if (isEnteringAutoModeFirstTime) {
|
|
1460
1460
|
// Store previous mode so we can revert if user declines
|
|
1461
1461
|
setPreviousModeBeforeAuto(toolPermissionContext.mode);
|
|
@@ -1494,7 +1494,7 @@ function PromptInput({
|
|
|
1494
1494
|
// carousel", not "decline". Reverting causes a ping-pong loop: auto reverts to
|
|
1495
1495
|
// the prior mode, whose next mode is auto again, forever.
|
|
1496
1496
|
// The dialog's own decline button (handleAutoModeOptInDecline) handles revert.
|
|
1497
|
-
if (
|
|
1497
|
+
if (true) {
|
|
1498
1498
|
if (showAutoModeOptIn || autoModeOptInTimeoutRef.current) {
|
|
1499
1499
|
if (showAutoModeOptIn) {
|
|
1500
1500
|
logEvent('tengu_auto_mode_opt_in_dialog_decline', {});
|
|
@@ -1554,7 +1554,7 @@ function PromptInput({
|
|
|
1554
1554
|
|
|
1555
1555
|
// Handler for auto mode opt-in dialog acceptance
|
|
1556
1556
|
const handleAutoModeOptInAccept = useCallback(() => {
|
|
1557
|
-
if (
|
|
1557
|
+
if (true) {
|
|
1558
1558
|
setShowAutoModeOptIn(false);
|
|
1559
1559
|
setPreviousModeBeforeAuto(null);
|
|
1560
1560
|
|
|
@@ -1583,7 +1583,7 @@ function PromptInput({
|
|
|
1583
1583
|
|
|
1584
1584
|
// Handler for auto mode opt-in dialog decline
|
|
1585
1585
|
const handleAutoModeOptInDecline = useCallback(() => {
|
|
1586
|
-
if (
|
|
1586
|
+
if (true) {
|
|
1587
1587
|
logForDebugging(`[auto-mode] handleAutoModeOptInDecline: reverting to ${previousModeBeforeAuto}, setting isAutoModeAvailable=false`);
|
|
1588
1588
|
setShowAutoModeOptIn(false);
|
|
1589
1589
|
if (autoModeOptInTimeoutRef.current) {
|
|
@@ -2114,7 +2114,7 @@ function PromptInput({
|
|
|
2114
2114
|
// slot's overflowY:hidden clip (same pattern as SuggestionsOverlay).
|
|
2115
2115
|
// Must be called before early returns below to satisfy rules-of-hooks.
|
|
2116
2116
|
// Memoized so the portal useEffect doesn't churn on every PromptInput render.
|
|
2117
|
-
const autoModeOptInDialog = useMemo(() =>
|
|
2117
|
+
const autoModeOptInDialog = useMemo(() => true && showAutoModeOptIn ? <AutoModeOptInDialog onAccept={handleAutoModeOptInAccept} onDecline={handleAutoModeOptInDecline} /> : null, [showAutoModeOptIn, handleAutoModeOptInAccept, handleAutoModeOptInDecline]);
|
|
2118
2118
|
useSetPromptOverlayDialog(isFullscreenEnvEnabled() ? autoModeOptInDialog : null);
|
|
2119
2119
|
if (showBashesDialog) {
|
|
2120
2120
|
return <BackgroundTasksDialog onDone={() => setShowBashesDialog(false)} toolUseContext={getToolUseContext(messages, [], new AbortController(), mainLoopModel)} initialDetailTaskId={typeof showBashesDialog === 'string' ? showBashesDialog : undefined} />;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
// biome-ignore-all assist/source/organizeImports: ANT-ONLY import markers must not be reordered
|
|
3
3
|
import { feature } from 'bun:bundle';
|
|
4
4
|
import { Box, Text, useTheme, useThemeSetting, useTerminalFocus } from '../../ink.js';
|
|
@@ -125,7 +125,7 @@ export function Config({
|
|
|
125
125
|
// Show auto in the default-mode dropdown when the user has opted in OR the
|
|
126
126
|
// config is fully 'enabled' — even if currently circuit-broken ('disabled'),
|
|
127
127
|
// an opted-in user should still see it in settings (it's a temporary state).
|
|
128
|
-
const showAutoInDefaultModePicker =
|
|
128
|
+
const showAutoInDefaultModePicker = true ? hasAutoModeOptInAnySource() || getAutoModeEnabledState() === 'enabled' : false;
|
|
129
129
|
// Chat/Transcript view picker is visible to entitled users (pass the GB
|
|
130
130
|
// gate) even if they haven't opted in this session — it IS the persistent
|
|
131
131
|
// opt-in. 'chat' written here is read at next startup by main.tsx which
|
|
@@ -497,9 +497,9 @@ export function Config({
|
|
|
497
497
|
value: settingsData?.permissions?.defaultMode || 'default',
|
|
498
498
|
options: (() => {
|
|
499
499
|
const priorityOrder: PermissionMode[] = ['default', 'plan'];
|
|
500
|
-
const allModes: readonly PermissionMode[] =
|
|
500
|
+
const allModes: readonly PermissionMode[] = true ? PERMISSION_MODES : EXTERNAL_PERMISSION_MODES;
|
|
501
501
|
const excluded: PermissionMode[] = ['bypassPermissions'];
|
|
502
|
-
if (
|
|
502
|
+
if (true && !showAutoInDefaultModePicker) {
|
|
503
503
|
excluded.push('auto');
|
|
504
504
|
}
|
|
505
505
|
return [...priorityOrder, ...allModes.filter(m => !priorityOrder.includes(m) && !excluded.includes(m))];
|
|
@@ -541,7 +541,7 @@ export function Config({
|
|
|
541
541
|
value: mode as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
|
-
}, ...(
|
|
544
|
+
}, ...(true && showAutoInDefaultModePicker ? [{
|
|
545
545
|
id: 'useAutoModeDuringPlan',
|
|
546
546
|
label: 'Use auto mode during plan',
|
|
547
547
|
value: (settingsData as {
|
|
@@ -1204,7 +1204,7 @@ export function Config({
|
|
|
1204
1204
|
autoUpdatesChannel: iu?.autoUpdatesChannel,
|
|
1205
1205
|
minimumVersion: iu?.minimumVersion,
|
|
1206
1206
|
language: iu?.language,
|
|
1207
|
-
...(
|
|
1207
|
+
...(true ? {
|
|
1208
1208
|
useAutoModeDuringPlan: (iu as {
|
|
1209
1209
|
useAutoModeDuringPlan?: boolean;
|
|
1210
1210
|
} | undefined)?.useAutoModeDuringPlan
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle';
|
|
1
|
+
import { feature } from 'bun:bundle';
|
|
2
2
|
import figures from 'figures';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { SentryErrorBoundary } from 'src/components/SentryErrorBoundary.js';
|
|
@@ -85,14 +85,14 @@ export function UserToolSuccessMessage({
|
|
|
85
85
|
return <Box flexDirection="column">
|
|
86
86
|
<Box flexDirection="column" width={rendersAsAssistantText ? undefined : width}>
|
|
87
87
|
{renderedMessage}
|
|
88
|
-
{
|
|
88
|
+
{true ? classifierRule && <MessageResponse height={1}>
|
|
89
89
|
<Text dimColor>
|
|
90
90
|
<Text color="success">{figures.tick}</Text>
|
|
91
91
|
{' Auto-approved \u00b7 matched '}
|
|
92
92
|
{`"${classifierRule}"`}
|
|
93
93
|
</Text>
|
|
94
94
|
</MessageResponse> : null}
|
|
95
|
-
{
|
|
95
|
+
{true ? yoloReason && <MessageResponse height={1}>
|
|
96
96
|
<Text dimColor>Allowed by auto mode classifier</Text>
|
|
97
97
|
</MessageResponse> : null}
|
|
98
98
|
</Box>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { feature } from 'bun:bundle';
|
|
3
3
|
import figures from 'figures';
|
|
4
4
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -258,7 +258,7 @@ function BashPermissionRequestInner({
|
|
|
258
258
|
// and only ever transitions true→false, so capturing the mount-time value is
|
|
259
259
|
// sufficient — no latch/ref needed. The feature() ternary keeps the property
|
|
260
260
|
// read out of external builds (forbidden-string check).
|
|
261
|
-
const [classifierWasChecking] = useState(
|
|
261
|
+
const [classifierWasChecking] = useState(true ? !!toolUseConfirm.classifierCheckInProgress : false);
|
|
262
262
|
|
|
263
263
|
// These derive solely from the tool input (fixed for the dialog lifetime).
|
|
264
264
|
// The shimmer clock used to live in this component and re-render it at 20fps
|
|
@@ -315,7 +315,7 @@ function BashPermissionRequestInner({
|
|
|
315
315
|
}, [toolUseConfirm]);
|
|
316
316
|
useKeybinding('confirm:no', handleDismissCheckmark, {
|
|
317
317
|
context: 'Confirmation',
|
|
318
|
-
isActive:
|
|
318
|
+
isActive: true ? !!toolUseConfirm.classifierAutoApproved : false
|
|
319
319
|
});
|
|
320
320
|
function onSelect(value_0: string) {
|
|
321
321
|
// Map options to numeric values for analytics (strings not allowed in logEvent)
|
|
@@ -325,7 +325,7 @@ function BashPermissionRequestInner({
|
|
|
325
325
|
'yes-prefix-edited': 2,
|
|
326
326
|
no: 3
|
|
327
327
|
};
|
|
328
|
-
if (
|
|
328
|
+
if (true) {
|
|
329
329
|
optionIndex = {
|
|
330
330
|
yes: 1,
|
|
331
331
|
'yes-apply-suggestions': 2,
|
|
@@ -359,7 +359,7 @@ function BashPermissionRequestInner({
|
|
|
359
359
|
onDone();
|
|
360
360
|
return;
|
|
361
361
|
}
|
|
362
|
-
if (
|
|
362
|
+
if (true && value_0 === 'yes-classifier-reviewed') {
|
|
363
363
|
const trimmedDescription = classifierDescription.trim();
|
|
364
364
|
logUnaryPermissionEvent('tool_use_single', toolUseConfirm, 'accept');
|
|
365
365
|
if (!trimmedDescription) {
|
|
@@ -424,7 +424,7 @@ function BashPermissionRequestInner({
|
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
const classifierSubtitle =
|
|
427
|
+
const classifierSubtitle = true ? toolUseConfirm.classifierAutoApproved ? <Text>
|
|
428
428
|
<Text color="success">{figures.tick} Auto-approved</Text>
|
|
429
429
|
{toolUseConfirm.classifierMatchedRule && <Text dimColor>
|
|
430
430
|
{' \u00b7 matched "'}
|
|
@@ -456,17 +456,17 @@ function BashPermissionRequestInner({
|
|
|
456
456
|
<Box flexDirection="column">
|
|
457
457
|
<PermissionRuleExplanation permissionResult={toolUseConfirm.permissionResult} toolType="command" />
|
|
458
458
|
{destructiveWarning_0 && <Box marginBottom={1}>
|
|
459
|
-
<Text color="warning" dimColor={
|
|
459
|
+
<Text color="warning" dimColor={true ? toolUseConfirm.classifierAutoApproved : false}>
|
|
460
460
|
{destructiveWarning_0}
|
|
461
461
|
</Text>
|
|
462
462
|
</Box>}
|
|
463
|
-
<Text dimColor={
|
|
463
|
+
<Text dimColor={true ? toolUseConfirm.classifierAutoApproved : false}>
|
|
464
464
|
Do you want to proceed?
|
|
465
465
|
</Text>
|
|
466
|
-
<Select options={
|
|
466
|
+
<Select options={true ? toolUseConfirm.classifierAutoApproved ? options.map(o => ({
|
|
467
467
|
...o,
|
|
468
468
|
disabled: true
|
|
469
|
-
})) : options : options} isDisabled={
|
|
469
|
+
})) : options : options} isDisabled={true ? toolUseConfirm.classifierAutoApproved : false} inlineDescriptions onChange={onSelect} onCancel={() => handleReject()} onFocus={handleFocus} onInputModeToggle={handleInputModeToggle} />
|
|
470
470
|
</Box>
|
|
471
471
|
<Box justifyContent="space-between" marginTop={1}>
|
|
472
472
|
<Text dimColor>
|
package/src/components/permissions/ExitPlanModePermissionRequest/ExitPlanModePermissionRequest.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle';
|
|
1
|
+
import { feature } from 'bun:bundle';
|
|
2
2
|
import type { UUID } from 'crypto';
|
|
3
3
|
import figures from 'figures';
|
|
4
4
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -40,7 +40,7 @@ import type { PermissionRequestProps } from '../PermissionRequest.js';
|
|
|
40
40
|
import { PermissionRuleExplanation } from '../PermissionRuleExplanation.js';
|
|
41
41
|
|
|
42
42
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
43
|
-
const autoModeStateModule =
|
|
43
|
+
const autoModeStateModule = true ? require('../../../utils/permissions/autoModeState.js') as typeof import('../../../utils/permissions/autoModeState.js') : null;
|
|
44
44
|
import type { Base64ImageSource, ImageBlockParam } from '@anthropic-ai/sdk/resources/messages.mjs';
|
|
45
45
|
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
46
46
|
import type { PastedContent } from '../../../utils/config.js';
|
|
@@ -310,7 +310,7 @@ export function ExitPlanModePermissionRequest({
|
|
|
310
310
|
|
|
311
311
|
// If auto was active during plan (from auto mode or opt-in) and NOT going
|
|
312
312
|
// to auto, deactivate auto + restore permissions + fire exit attachment.
|
|
313
|
-
if (
|
|
313
|
+
if (true) {
|
|
314
314
|
const goingToAuto = (value === 'yes-resume-auto-mode' || value === 'yes-auto-clear-context') && isAutoModeGateEnabled();
|
|
315
315
|
// isAutoModeActive() is the authoritative signal — prePlanMode/
|
|
316
316
|
// strippedDangerousRules are stale after transitionPlanAutoMode
|
|
@@ -332,7 +332,7 @@ export function ExitPlanModePermissionRequest({
|
|
|
332
332
|
// Clear-context options: set pending plan implementation and reject the dialog
|
|
333
333
|
// The REPL will handle context clear and trigger a fresh query
|
|
334
334
|
// Keep-context options skip this block and go through the normal flow below
|
|
335
|
-
const isResumeAutoOption =
|
|
335
|
+
const isResumeAutoOption = true ? value === 'yes-resume-auto-mode' : false;
|
|
336
336
|
const isKeepContextOption = value === 'yes-accept-edits-keep-context' || value === 'yes-default-keep-context' || isResumeAutoOption;
|
|
337
337
|
if (value !== 'no') {
|
|
338
338
|
autoNameSessionFromPlan(currentPlan, setAppState, !isKeepContextOption);
|
|
@@ -344,7 +344,7 @@ export function ExitPlanModePermissionRequest({
|
|
|
344
344
|
mode = 'bypassPermissions';
|
|
345
345
|
} else if (value === 'yes-accept-edits') {
|
|
346
346
|
mode = 'acceptEdits';
|
|
347
|
-
} else if (
|
|
347
|
+
} else if (true && value === 'yes-auto-clear-context' && isAutoModeGateEnabled()) {
|
|
348
348
|
// REPL's processInitialMessage handles stripDangerousPermissions + mode,
|
|
349
349
|
// but does NOT set autoModeActive. Gate-off falls through to 'default'.
|
|
350
350
|
mode = 'auto';
|
|
@@ -397,7 +397,7 @@ export function ExitPlanModePermissionRequest({
|
|
|
397
397
|
// Handle auto keep-context option — needs special handling because
|
|
398
398
|
// buildPermissionUpdates maps auto to 'default' via toExternalPermissionMode.
|
|
399
399
|
// We set the mode directly via setAppState and sync the bootstrap state.
|
|
400
|
-
if (
|
|
400
|
+
if (true && value === 'yes-resume-auto-mode' && isAutoModeGateEnabled()) {
|
|
401
401
|
logEvent('tengu_plan_exit', {
|
|
402
402
|
planLengthChars: currentPlan.length,
|
|
403
403
|
outcome: value as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
|
|
@@ -430,7 +430,7 @@ export function ExitPlanModePermissionRequest({
|
|
|
430
430
|
const keepContextModes: Record<string, PermissionMode> = {
|
|
431
431
|
'yes-accept-edits-keep-context': toolPermissionContext.isBypassPermissionsModeAvailable ? 'bypassPermissions' : 'acceptEdits',
|
|
432
432
|
'yes-default-keep-context': 'default',
|
|
433
|
-
...(
|
|
433
|
+
...(true ? {
|
|
434
434
|
'yes-resume-auto-mode': 'default' as const
|
|
435
435
|
} : {})
|
|
436
436
|
};
|
|
@@ -564,7 +564,7 @@ export function ExitPlanModePermissionRequest({
|
|
|
564
564
|
interviewPhaseEnabled: isPlanModeInterviewPhaseEnabled(),
|
|
565
565
|
planStructureVariant
|
|
566
566
|
});
|
|
567
|
-
if (
|
|
567
|
+
if (true) {
|
|
568
568
|
const autoWasUsedDuringPlan = autoModeStateModule?.isAutoModeActive() ?? false;
|
|
569
569
|
if (autoWasUsedDuringPlan) {
|
|
570
570
|
autoModeStateModule?.setAutoModeActive(false);
|
|
@@ -689,7 +689,7 @@ export function buildPlanApprovalOptions({
|
|
|
689
689
|
const options: OptionWithDescription<ResponseValue>[] = [];
|
|
690
690
|
const usedLabel = usedPercent !== null ? ` (${usedPercent}% used)` : '';
|
|
691
691
|
if (showClearContext) {
|
|
692
|
-
if (
|
|
692
|
+
if (true && isAutoModeAvailable) {
|
|
693
693
|
options.push({
|
|
694
694
|
label: `Yes, clear context${usedLabel} and use auto mode`,
|
|
695
695
|
value: 'yes-auto-clear-context'
|
|
@@ -708,7 +708,7 @@ export function buildPlanApprovalOptions({
|
|
|
708
708
|
}
|
|
709
709
|
|
|
710
710
|
// Slot 2: keep-context with elevated mode (same priority: auto > bypass > edits).
|
|
711
|
-
if (
|
|
711
|
+
if (true && isAutoModeAvailable) {
|
|
712
712
|
options.push({
|
|
713
713
|
label: 'Yes, and use auto mode',
|
|
714
714
|
value: 'yes-resume-auto-mode'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { feature } from 'bun:bundle';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import figures from 'figures';
|
|
@@ -21,7 +21,7 @@ type PermissionDecisionInfoItemProps = {
|
|
|
21
21
|
function decisionReasonDisplayString(decisionReason: PermissionDecisionReason & {
|
|
22
22
|
type: Exclude<PermissionDecisionReason['type'], 'subcommandResults'>;
|
|
23
23
|
}): string {
|
|
24
|
-
if ((
|
|
24
|
+
if ((true || true) && decisionReason.type === 'classifier') {
|
|
25
25
|
return `${chalk.bold(decisionReason.classifier)} classifier: ${decisionReason.reason}`;
|
|
26
26
|
}
|
|
27
27
|
switch (decisionReason.type) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { feature } from 'bun:bundle';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import React from 'react';
|
|
@@ -22,7 +22,7 @@ function stringsForDecisionReason(reason: PermissionDecisionReason | undefined,
|
|
|
22
22
|
if (!reason) {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
if ((
|
|
25
|
+
if ((true || true) && reason.type === 'classifier') {
|
|
26
26
|
if (reason.classifier === 'auto-mode') {
|
|
27
27
|
return {
|
|
28
28
|
reasonString: `Auto mode classifier requires confirmation for this ${toolType}.\n${reason.reason}`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle'
|
|
1
|
+
import { feature } from 'bun:bundle'
|
|
2
2
|
import { useEffect, useRef } from 'react'
|
|
3
3
|
import {
|
|
4
4
|
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
|
|
@@ -65,7 +65,7 @@ function decisionReasonToString(
|
|
|
65
65
|
return 'No decision reason'
|
|
66
66
|
}
|
|
67
67
|
if (
|
|
68
|
-
(
|
|
68
|
+
(true || true) &&
|
|
69
69
|
decisionReason.type === 'classifier'
|
|
70
70
|
) {
|
|
71
71
|
return `Classifier: ${decisionReason.classifier}, Reason: ${decisionReason.reason}`
|
package/src/constants/betas.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle'
|
|
1
|
+
import { feature } from 'bun:bundle'
|
|
2
2
|
|
|
3
3
|
export const CLAUDE_CODE_20250219_BETA_HEADER = 'claude-code-20250219'
|
|
4
4
|
export const INTERLEAVED_THINKING_BETA_HEADER =
|
|
@@ -23,7 +23,7 @@ export const TOKEN_EFFICIENT_TOOLS_BETA_HEADER =
|
|
|
23
23
|
export const SUMMARIZE_CONNECTOR_TEXT_BETA_HEADER = feature('CONNECTOR_TEXT')
|
|
24
24
|
? 'summarize-connector-text-2026-03-13'
|
|
25
25
|
: ''
|
|
26
|
-
export const AFK_MODE_BETA_HEADER =
|
|
26
|
+
export const AFK_MODE_BETA_HEADER = true
|
|
27
27
|
? 'afk-mode-2026-01-31'
|
|
28
28
|
: ''
|
|
29
29
|
export const CLI_INTERNAL_BETA_HEADER =
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle'
|
|
1
|
+
import { feature } from 'bun:bundle'
|
|
2
2
|
import { useEffect, useRef } from 'react'
|
|
3
3
|
import { useNotifications } from 'src/context/notifications.js'
|
|
4
4
|
import { getIsRemoteMode } from '../../bootstrap/state.js'
|
|
@@ -29,7 +29,7 @@ export function useAutoModeUnavailableNotification(): void {
|
|
|
29
29
|
const prevMode = prevModeRef.current
|
|
30
30
|
prevModeRef.current = mode
|
|
31
31
|
|
|
32
|
-
if (!
|
|
32
|
+
if (!true) return
|
|
33
33
|
if (getIsRemoteMode()) return
|
|
34
34
|
if (shownRef.current) return
|
|
35
35
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle'
|
|
1
|
+
import { feature } from 'bun:bundle'
|
|
2
2
|
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages.mjs'
|
|
3
3
|
import {
|
|
4
4
|
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
|
|
@@ -171,7 +171,7 @@ function createPermissionContext(
|
|
|
171
171
|
}
|
|
172
172
|
return { behavior: 'ask', message, contentBlocks }
|
|
173
173
|
},
|
|
174
|
-
...(
|
|
174
|
+
...(true
|
|
175
175
|
? {
|
|
176
176
|
async tryClassifier(
|
|
177
177
|
pendingClassifierCheck: PendingClassifierCheck | undefined,
|
|
@@ -189,7 +189,7 @@ function createPermissionContext(
|
|
|
189
189
|
return null
|
|
190
190
|
}
|
|
191
191
|
if (
|
|
192
|
-
|
|
192
|
+
true &&
|
|
193
193
|
classifierDecision.type === 'classifier'
|
|
194
194
|
) {
|
|
195
195
|
const matchedRule = classifierDecision.reason.match(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle'
|
|
1
|
+
import { feature } from 'bun:bundle'
|
|
2
2
|
import type { PendingClassifierCheck } from '../../../types/permissions.js'
|
|
3
3
|
import { logError } from '../../../utils/log.js'
|
|
4
4
|
import type { PermissionDecision } from '../../../utils/permissions/PermissionResult.js'
|
|
@@ -38,7 +38,7 @@ async function handleCoordinatorPermission(
|
|
|
38
38
|
if (hookResult) return hookResult
|
|
39
39
|
|
|
40
40
|
// 2. Try classifier (slow, inference -- bash only)
|
|
41
|
-
const classifierResult =
|
|
41
|
+
const classifierResult = true
|
|
42
42
|
? await ctx.tryClassifier?.(params.pendingClassifierCheck, updatedInput)
|
|
43
43
|
: null
|
|
44
44
|
if (classifierResult) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle'
|
|
1
|
+
import { feature } from 'bun:bundle'
|
|
2
2
|
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages.mjs'
|
|
3
3
|
import { randomUUID } from 'crypto'
|
|
4
4
|
import { logForDebugging } from 'src/utils/debug.js'
|
|
@@ -84,7 +84,7 @@ function handleInteractivePermission(
|
|
|
84
84
|
const displayInput = result.updatedInput ?? ctx.input
|
|
85
85
|
|
|
86
86
|
function clearClassifierIndicator(): void {
|
|
87
|
-
if (
|
|
87
|
+
if (true) {
|
|
88
88
|
ctx.updateQueueItem({ classifierCheckInProgress: false })
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -98,7 +98,7 @@ function handleInteractivePermission(
|
|
|
98
98
|
toolUseID: ctx.toolUseID,
|
|
99
99
|
permissionResult: result,
|
|
100
100
|
permissionPromptStartTimeMs,
|
|
101
|
-
...(
|
|
101
|
+
...(true
|
|
102
102
|
? {
|
|
103
103
|
classifierCheckInProgress:
|
|
104
104
|
!!result.pendingClassifierCheck &&
|
|
@@ -432,7 +432,7 @@ function handleInteractivePermission(
|
|
|
432
432
|
|
|
433
433
|
// Execute bash classifier check asynchronously (if applicable)
|
|
434
434
|
if (
|
|
435
|
-
|
|
435
|
+
true &&
|
|
436
436
|
result.pendingClassifierCheck &&
|
|
437
437
|
ctx.tool.name === BASH_TOOL_NAME &&
|
|
438
438
|
!awaitAutomatedChecksBeforeDialog
|
|
@@ -467,7 +467,7 @@ function handleInteractivePermission(
|
|
|
467
467
|
: undefined
|
|
468
468
|
|
|
469
469
|
// Show auto-approved transition with dimmed options
|
|
470
|
-
if (
|
|
470
|
+
if (true) {
|
|
471
471
|
ctx.updateQueueItem({
|
|
472
472
|
classifierCheckInProgress: false,
|
|
473
473
|
classifierAutoApproved: true,
|
|
@@ -476,7 +476,7 @@ function handleInteractivePermission(
|
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
if (
|
|
479
|
-
|
|
479
|
+
true &&
|
|
480
480
|
decisionReason.type === 'classifier'
|
|
481
481
|
) {
|
|
482
482
|
if (decisionReason.classifier === 'auto-mode') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle'
|
|
1
|
+
import { feature } from 'bun:bundle'
|
|
2
2
|
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages.mjs'
|
|
3
3
|
import type { PendingClassifierCheck } from '../../../types/permissions.js'
|
|
4
4
|
import { isAgentSwarmsEnabled } from '../../../utils/agentSwarmsEnabled.js'
|
|
@@ -49,7 +49,7 @@ async function handleSwarmWorkerPermission(
|
|
|
49
49
|
// For bash commands, try classifier auto-approval before forwarding to
|
|
50
50
|
// the leader. Agents await the classifier result (rather than racing it
|
|
51
51
|
// against user interaction like the main agent).
|
|
52
|
-
const classifierResult =
|
|
52
|
+
const classifierResult = true
|
|
53
53
|
? await ctx.tryClassifier?.(params.pendingClassifierCheck, updatedInput)
|
|
54
54
|
: null
|
|
55
55
|
if (classifierResult) {
|