fix: 批量修正 external 字面量

This commit is contained in:
claude-code-best
2026-04-02 17:01:39 +08:00
parent 799dacc407
commit ac1f02958c
31 changed files with 97 additions and 100 deletions

View File

@@ -81,7 +81,7 @@ export type AutoRunIssueReason = 'feedback_survey_bad' | 'feedback_survey_good';
*/
export function shouldAutoRunIssue(reason: AutoRunIssueReason): boolean {
// Only for Ant users
if (("external" as string) !== 'ant') {
if ((process.env.USER_TYPE) !== 'ant') {
return false;
}
switch (reason) {
@@ -100,7 +100,7 @@ export function shouldAutoRunIssue(reason: AutoRunIssueReason): boolean {
*/
export function getAutoRunCommand(reason: AutoRunIssueReason): string {
// Only ant builds have the /good-claude command
if (("external" as string) === 'ant' && reason === 'feedback_survey_good') {
if ((process.env.USER_TYPE) === 'ant' && reason === 'feedback_survey_good') {
return '/good-claude';
}
return '/issue';

View File

@@ -273,7 +273,7 @@ async function executeForkedSlashCommand(command: CommandBase & PromptCommand, a
logForDebugging(`Forked slash command /${command.name} completed with agent ${agentId}`);
// Prepend debug log for ant users so it appears inside the command output
if (("external" as string) === 'ant') {
if ((process.env.USER_TYPE) === 'ant') {
resultText = `[ANT-ONLY] API calls: ${getDisplayPath(getDumpPromptsPath(agentId))}\n${resultText}`;
}
@@ -427,7 +427,7 @@ export async function processSlashCommand(inputString: string, precedingInputBlo
logEvent('tengu_input_command', {
...eventData,
invocation_trigger: 'user-slash' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
...(("external" as string) === 'ant' && {
...((process.env.USER_TYPE) === 'ant' && {
skill_name: commandName as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
...(returnedCommand.type === 'prompt' && {
skill_source: returnedCommand.source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
@@ -495,7 +495,7 @@ export async function processSlashCommand(inputString: string, precedingInputBlo
logEvent('tengu_input_command', {
...eventData,
invocation_trigger: 'user-slash' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
...(("external" as string) === 'ant' && {
...((process.env.USER_TYPE) === 'ant' && {
skill_name: commandName as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
...(returnedCommand.type === 'prompt' && {
skill_source: returnedCommand.source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS

View File

@@ -26,7 +26,7 @@ export type Property = {
};
export type Diagnostic = React.ReactNode;
export function buildSandboxProperties(): Property[] {
if (("external" as string) !== 'ant') {
if ((process.env.USER_TYPE) !== 'ant') {
return [];
}
const isSandboxed = SandboxManager.isSandboxingEnabled();