diff --git a/src/components/LogoV2/LogoV2.tsx b/src/components/LogoV2/LogoV2.tsx index 528c0954c..275025748 100644 --- a/src/components/LogoV2/LogoV2.tsx +++ b/src/components/LogoV2/LogoV2.tsx @@ -57,6 +57,9 @@ const ChannelsNoticeModule = ? (require('./ChannelsNotice.js') as typeof import('./ChannelsNotice.js')) : null; /* eslint-enable @typescript-eslint/no-require-imports */ +function ChannelsNoticeIfLoaded() { + return ChannelsNoticeModule ? : null +} import { SandboxManager } from 'src/utils/sandbox/sandbox-adapter.js'; import { useShowGuestPassesUpsell, incrementGuestPassesSeenCount } from './GuestPassesUpsell.js'; import { @@ -157,7 +160,7 @@ export function LogoV2(): React.ReactNode { {/* NOTE: Opus 1M merge notice disabled */} - {ChannelsNoticeModule && } + {isDebugMode() && ( Debug mode enabled @@ -223,7 +226,7 @@ export function LogoV2(): React.ReactNode { const separator = ' · '; const atPrefix = '@'; const cwdAvailableWidth = agentName - ? columns - layoutWidth - atPrefix.length - stringWidth(agentName) - separator.length + ? columns - layoutWidth - atPrefix.length - stringWidth(agentName!) - separator.length : columns - layoutWidth; const truncatedCwd = truncatePath(cwd, Math.max(cwdAvailableWidth, 10)); // OffscreenFreeze: logo is the first thing to enter scrollback; useMainLoopModel() @@ -260,7 +263,7 @@ export function LogoV2(): React.ReactNode { {/* NOTE: Opus 1M merge notice disabled */} - {ChannelsNoticeModule && } + {showSandboxStatus && ( Your bash commands will be sandboxed. Disable with /sandbox. @@ -276,13 +279,13 @@ export function LogoV2(): React.ReactNode { const modelLine = notLoggedIn ? 'Not logged in' : !process.env.IS_DEMO && config.oauthAccount?.organizationName - ? `${modelDisplayName} · ${billingType} · ${config.oauthAccount.organizationName}` + ? `${modelDisplayName} · ${billingType} · ${config.oauthAccount!.organizationName}` : `${modelDisplayName} · ${billingType}`; // Calculate cwd width accounting for agent name if present const cwdSeparator = ' · '; const cwdAtPrefix = '@'; const cwdAvailableWidth = agentName - ? LEFT_PANEL_MAX_WIDTH - cwdAtPrefix.length - stringWidth(agentName) - cwdSeparator.length + ? LEFT_PANEL_MAX_WIDTH - cwdAtPrefix.length - stringWidth(agentName!) - cwdSeparator.length : LEFT_PANEL_MAX_WIDTH; const truncatedCwd = truncatePath(cwd, Math.max(cwdAvailableWidth, 10)); const cwdLine = agentName ? `@${agentName} · ${truncatedCwd}` : truncatedCwd; @@ -362,8 +365,8 @@ export function LogoV2(): React.ReactNode { {/* NOTE: Opus 1M merge notice disabled */} - {ChannelsNoticeModule && } - {isDebugMode() && ( + + {isDebugMode() && ( Debug mode enabled Logging to: {isDebugToStdErr() ? 'stderr' : getDebugLogPath()} @@ -383,7 +386,7 @@ export function LogoV2(): React.ReactNode { {announcement && ( {!process.env.IS_DEMO && config.oauthAccount?.organizationName && ( - Message from {config.oauthAccount.organizationName}: + Message from {config.oauthAccount!.organizationName}: )} {announcement} diff --git a/src/main.tsx b/src/main.tsx index f50629bb7..c36848c35 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1524,11 +1524,14 @@ async function run(): Promise { new Option("--dangerously-skip-permissions", "Bypass all permission checks. Recommended only for sandboxes with no internet access.") .argParser(() => true), ) - // .option( - // "--allow-dangerously-skip-permissions", - // "Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.", - // () => true, - // ) + .addOption( + new Option( + "--allow-dangerously-skip-permissions", + "Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.", + ) + .argParser(() => true) + .hideHelp(), + ) .addOption( new Option( "--thinking ", diff --git a/src/types/global.d.ts b/src/types/global.d.ts index df6cc7bd2..64dab17c5 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -79,3 +79,31 @@ declare module '*.css' { const content: string export default content } +declare module 'doubaoime-asr' { + export interface ASRResponse { + type: number + text: string + is_final: boolean + errorMsg?: string + [key: string]: unknown + } + export class ASRConfig { + constructor(options?: Record) + ensureCredentials(): Promise + [key: string]: unknown + } + export const ResponseType: { + SESSION_STARTED: number + VAD_START: number + INTERIM_RESULT: number + FINAL_RESULT: number + ERROR: number + SESSION_FINISHED: number + [key: string]: number + } + export function transcribeRealtime( + audioSource: AsyncIterable, + options?: { config: ASRConfig }, + ): AsyncGenerator + export function createASRStream(options?: Record): AsyncGenerator +}