mirror of
http://10.0.2.1:3031/sauer/claude-code.git
synced 2026-06-30 20:36:57 +10:00
275 lines
28 KiB
TypeScript
275 lines
28 KiB
TypeScript
|
|
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 = <UserPlanMessage addMargin={addMargin} planContent={planContent} />;
|
||
|
|
$[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("<bash-stdout") || param.text.startsWith("<bash-stderr")) {
|
||
|
|
let t1;
|
||
|
|
if ($[3] !== param.text || $[4] !== verbose) {
|
||
|
|
t1 = <UserBashOutputMessage content={param.text} verbose={verbose} />;
|
||
|
|
$[3] = param.text;
|
||
|
|
$[4] = verbose;
|
||
|
|
$[5] = t1;
|
||
|
|
} else {
|
||
|
|
t1 = $[5];
|
||
|
|
}
|
||
|
|
return t1;
|
||
|
|
}
|
||
|
|
if (param.text.startsWith("<local-command-stdout") || param.text.startsWith("<local-command-stderr")) {
|
||
|
|
let t1;
|
||
|
|
if ($[6] !== param.text) {
|
||
|
|
t1 = <UserLocalCommandOutputMessage content={param.text} />;
|
||
|
|
$[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 = <MessageResponse height={1}><InterruptedByUser /></MessageResponse>;
|
||
|
|
$[8] = t1;
|
||
|
|
} else {
|
||
|
|
t1 = $[8];
|
||
|
|
}
|
||
|
|
return t1;
|
||
|
|
}
|
||
|
|
if (feature("KAIROS_GITHUB_WEBHOOKS")) {
|
||
|
|
if (param.text.startsWith("<github-webhook-activity>")) {
|
||
|
|
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 = <UserGitHubWebhookMessage addMargin={addMargin} param={param} />;
|
||
|
|
$[10] = addMargin;
|
||
|
|
$[11] = param;
|
||
|
|
$[12] = t2;
|
||
|
|
} else {
|
||
|
|
t2 = $[12];
|
||
|
|
}
|
||
|
|
return t2;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (param.text.includes("<bash-input>")) {
|
||
|
|
let t1;
|
||
|
|
if ($[13] !== addMargin || $[14] !== param) {
|
||
|
|
t1 = <UserBashInputMessage addMargin={addMargin} param={param} />;
|
||
|
|
$[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 = <UserCommandMessage addMargin={addMargin} param={param} />;
|
||
|
|
$[16] = addMargin;
|
||
|
|
$[17] = param;
|
||
|
|
$[18] = t1;
|
||
|
|
} else {
|
||
|
|
t1 = $[18];
|
||
|
|
}
|
||
|
|
return t1;
|
||
|
|
}
|
||
|
|
if (param.text.includes("<user-memory-input>")) {
|
||
|
|
let t1;
|
||
|
|
if ($[19] !== addMargin || $[20] !== param.text) {
|
||
|
|
t1 = <UserMemoryInputMessage addMargin={addMargin} text={param.text} />;
|
||
|
|
$[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 = <UserTeammateMessage addMargin={addMargin} param={param} isTranscriptMode={isTranscriptMode} />;
|
||
|
|
$[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 = <UserAgentNotificationMessage addMargin={addMargin} param={param} />;
|
||
|
|
$[26] = addMargin;
|
||
|
|
$[27] = param;
|
||
|
|
$[28] = t1;
|
||
|
|
} else {
|
||
|
|
t1 = $[28];
|
||
|
|
}
|
||
|
|
return t1;
|
||
|
|
}
|
||
|
|
if (param.text.includes("<mcp-resource-update") || param.text.includes("<mcp-polling-update")) {
|
||
|
|
let t1;
|
||
|
|
if ($[29] !== addMargin || $[30] !== param) {
|
||
|
|
t1 = <UserResourceUpdateMessage addMargin={addMargin} param={param} />;
|
||
|
|
$[29] = addMargin;
|
||
|
|
$[30] = param;
|
||
|
|
$[31] = t1;
|
||
|
|
} else {
|
||
|
|
t1 = $[31];
|
||
|
|
}
|
||
|
|
return t1;
|
||
|
|
}
|
||
|
|
if (feature("FORK_SUBAGENT")) {
|
||
|
|
if (param.text.includes("<fork-boilerplate>")) {
|
||
|
|
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 = <UserForkBoilerplateMessage addMargin={addMargin} param={param} />;
|
||
|
|
$[33] = addMargin;
|
||
|
|
$[34] = param;
|
||
|
|
$[35] = t2;
|
||
|
|
} else {
|
||
|
|
t2 = $[35];
|
||
|
|
}
|
||
|
|
return t2;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (feature("UDS_INBOX")) {
|
||
|
|
if (param.text.includes("<cross-session-message")) {
|
||
|
|
let t1;
|
||
|
|
if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t1 = require("./UserCrossSessionMessage.js");
|
||
|
|
$[36] = t1;
|
||
|
|
} else {
|
||
|
|
t1 = $[36];
|
||
|
|
}
|
||
|
|
const {
|
||
|
|
UserCrossSessionMessage
|
||
|
|
} = t1 as typeof import('./UserCrossSessionMessage.js');
|
||
|
|
let t2;
|
||
|
|
if ($[37] !== addMargin || $[38] !== param) {
|
||
|
|
t2 = <UserCrossSessionMessage addMargin={addMargin} param={param} />;
|
||
|
|
$[37] = addMargin;
|
||
|
|
$[38] = param;
|
||
|
|
$[39] = t2;
|
||
|
|
} else {
|
||
|
|
t2 = $[39];
|
||
|
|
}
|
||
|
|
return t2;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (feature("KAIROS") || feature("KAIROS_CHANNELS")) {
|
||
|
|
if (param.text.includes("<channel source=\"")) {
|
||
|
|
let t1;
|
||
|
|
if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t1 = require("./UserChannelMessage.js");
|
||
|
|
$[40] = t1;
|
||
|
|
} else {
|
||
|
|
t1 = $[40];
|
||
|
|
}
|
||
|
|
const {
|
||
|
|
UserChannelMessage
|
||
|
|
} = t1 as typeof import('./UserChannelMessage.js');
|
||
|
|
let t2;
|
||
|
|
if ($[41] !== addMargin || $[42] !== param) {
|
||
|
|
t2 = <UserChannelMessage addMargin={addMargin} param={param} />;
|
||
|
|
$[41] = addMargin;
|
||
|
|
$[42] = param;
|
||
|
|
$[43] = t2;
|
||
|
|
} else {
|
||
|
|
t2 = $[43];
|
||
|
|
}
|
||
|
|
return t2;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
let t1;
|
||
|
|
if ($[44] !== addMargin || $[45] !== isTranscriptMode || $[46] !== param || $[47] !== timestamp) {
|
||
|
|
t1 = <UserPromptMessage addMargin={addMargin} param={param} isTranscriptMode={isTranscriptMode} timestamp={timestamp} />;
|
||
|
|
$[44] = addMargin;
|
||
|
|
$[45] = isTranscriptMode;
|
||
|
|
$[46] = param;
|
||
|
|
$[47] = timestamp;
|
||
|
|
$[48] = t1;
|
||
|
|
} else {
|
||
|
|
t1 = $[48];
|
||
|
|
}
|
||
|
|
return t1;
|
||
|
|
}
|
||
|
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJmZWF0dXJlIiwiVGV4dEJsb2NrUGFyYW0iLCJSZWFjdCIsIk5PX0NPTlRFTlRfTUVTU0FHRSIsIkNPTU1BTkRfTUVTU0FHRV9UQUciLCJMT0NB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