import { c as _c } from "react/compiler-runtime"; import { feature } from 'bun:bundle'; import type { TextBlockParam } from '@anthropic-ai/sdk/resources/index.mjs'; import * as React from 'react'; import { NO_CONTENT_MESSAGE } from '../../constants/messages.js'; import { COMMAND_MESSAGE_TAG, LOCAL_COMMAND_CAVEAT_TAG, TASK_NOTIFICATION_TAG, TEAMMATE_MESSAGE_TAG, TICK_TAG } from '../../constants/xml.js'; import { isAgentSwarmsEnabled } from '../../utils/agentSwarmsEnabled.js'; import { extractTag, INTERRUPT_MESSAGE, INTERRUPT_MESSAGE_FOR_TOOL_USE } from '../../utils/messages.js'; import { InterruptedByUser } from '../InterruptedByUser.js'; import { MessageResponse } from '../MessageResponse.js'; import { UserAgentNotificationMessage } from './UserAgentNotificationMessage.js'; import { UserBashInputMessage } from './UserBashInputMessage.js'; import { UserBashOutputMessage } from './UserBashOutputMessage.js'; import { UserCommandMessage } from './UserCommandMessage.js'; import { UserLocalCommandOutputMessage } from './UserLocalCommandOutputMessage.js'; import { UserMemoryInputMessage } from './UserMemoryInputMessage.js'; import { UserPlanMessage } from './UserPlanMessage.js'; import { UserPromptMessage } from './UserPromptMessage.js'; import { UserResourceUpdateMessage } from './UserResourceUpdateMessage.js'; import { UserTeammateMessage } from './UserTeammateMessage.js'; type Props = { addMargin: boolean; param: TextBlockParam; verbose: boolean; planContent?: string; isTranscriptMode?: boolean; timestamp?: string; }; export function UserTextMessage(t0) { const $ = _c(49); const { addMargin, param, verbose, planContent, isTranscriptMode, timestamp } = t0; if (param.text.trim() === NO_CONTENT_MESSAGE) { return null; } if (planContent) { let t1; if ($[0] !== addMargin || $[1] !== planContent) { t1 = ; $[0] = addMargin; $[1] = planContent; $[2] = t1; } else { t1 = $[2]; } return t1; } if (extractTag(param.text, TICK_TAG)) { return null; } if (param.text.includes(`<${LOCAL_COMMAND_CAVEAT_TAG}>`)) { return null; } if (param.text.startsWith("; $[3] = param.text; $[4] = verbose; $[5] = t1; } else { t1 = $[5]; } return t1; } if (param.text.startsWith("; $[6] = param.text; $[7] = t1; } else { t1 = $[7]; } return t1; } if (param.text === INTERRUPT_MESSAGE || param.text === INTERRUPT_MESSAGE_FOR_TOOL_USE) { let t1; if ($[8] === Symbol.for("react.memo_cache_sentinel")) { t1 = ; $[8] = t1; } else { t1 = $[8]; } return t1; } if (feature("KAIROS_GITHUB_WEBHOOKS")) { if (param.text.startsWith("")) { let t1; if ($[9] === Symbol.for("react.memo_cache_sentinel")) { t1 = require("./UserGitHubWebhookMessage.js"); $[9] = t1; } else { t1 = $[9]; } const { UserGitHubWebhookMessage } = t1 as typeof import('./UserGitHubWebhookMessage.js'); let t2; if ($[10] !== addMargin || $[11] !== param) { t2 = ; $[10] = addMargin; $[11] = param; $[12] = t2; } else { t2 = $[12]; } return t2; } } if (param.text.includes("")) { let t1; if ($[13] !== addMargin || $[14] !== param) { t1 = ; $[13] = addMargin; $[14] = param; $[15] = t1; } else { t1 = $[15]; } return t1; } if (param.text.includes(`<${COMMAND_MESSAGE_TAG}>`)) { let t1; if ($[16] !== addMargin || $[17] !== param) { t1 = ; $[16] = addMargin; $[17] = param; $[18] = t1; } else { t1 = $[18]; } return t1; } if (param.text.includes("")) { let t1; if ($[19] !== addMargin || $[20] !== param.text) { t1 = ; $[19] = addMargin; $[20] = param.text; $[21] = t1; } else { t1 = $[21]; } return t1; } if (isAgentSwarmsEnabled() && param.text.includes(`<${TEAMMATE_MESSAGE_TAG}`)) { let t1; if ($[22] !== addMargin || $[23] !== isTranscriptMode || $[24] !== param) { t1 = ; $[22] = addMargin; $[23] = isTranscriptMode; $[24] = param; $[25] = t1; } else { t1 = $[25]; } return t1; } if (param.text.includes(`<${TASK_NOTIFICATION_TAG}`)) { let t1; if ($[26] !== addMargin || $[27] !== param) { t1 = ; $[26] = addMargin; $[27] = param; $[28] = t1; } else { t1 = $[28]; } return t1; } if (param.text.includes("; $[29] = addMargin; $[30] = param; $[31] = t1; } else { t1 = $[31]; } return t1; } if (feature("FORK_SUBAGENT")) { if (param.text.includes("")) { let t1; if ($[32] === Symbol.for("react.memo_cache_sentinel")) { t1 = require("./UserForkBoilerplateMessage.js"); $[32] = t1; } else { t1 = $[32]; } const { UserForkBoilerplateMessage } = t1 as typeof import('./UserForkBoilerplateMessage.js'); let t2; if ($[33] !== addMargin || $[34] !== param) { t2 = ; $[33] = addMargin; $[34] = param; $[35] = t2; } else { t2 = $[35]; } return t2; } } if (feature("UDS_INBOX")) { if (param.text.includes("; $[37] = addMargin; $[38] = param; $[39] = t2; } else { t2 = $[39]; } return t2; } } if (feature("KAIROS") || feature("KAIROS_CHANNELS")) { if (param.text.includes("; $[41] = addMargin; $[42] = param; $[43] = t2; } else { t2 = $[43]; } return t2; } } let t1; if ($[44] !== addMargin || $[45] !== isTranscriptMode || $[46] !== param || $[47] !== timestamp) { t1 = ; $[44] = addMargin; $[45] = isTranscriptMode; $[46] = param; $[47] = timestamp; $[48] = t1; } else { t1 = $[48]; } return t1; }