MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / messageOf

Function messageOf

graph-ui/src/chat/AtlasChatPanel.tsx:132–158  ·  view source on GitHub ↗

The sentence a refused or failed turn shows instead of an answer.

(turn: ChatTurn)

Source from the content-addressed store, hash-verified

130
131/** The sentence a refused or failed turn shows instead of an answer. */
132function messageOf(turn: ChatTurn): string {
133 switch (turn.status) {
134 case 'compiling':
135 return CHAT_COMPILING;
136 case 'asking':
137 return CHAT_ASKING;
138 case 'refused':
139 return turn.refusal === 'policy'
140 ? CHAT_POLICY_MESSAGE
141 : turn.refusal === 'not-running'
142 ? CHAT_NOT_RUNNING_MESSAGE
143 : CHAT_OFF_MESSAGE;
144 case 'failed':
145 return chatFailed(turn.message);
146 case 'no-cards':
147 return CHAT_NO_CARDS_HINT;
148 // The candidate list says it better than a sentence beside it could.
149 case 'needs-choice':
150 return '';
151 default: {
152 const unavailable = /^model-(off|not-running|policy)$/.exec(turn.message);
153 return turn.message === 'thought-only' ? CHAT_THOUGHT_ONLY
154 : unavailable === null ? ''
155 : chatBuiltUnavailableMessage(unavailable[1] as 'off' | 'not-running' | 'policy');
156 }
157 }
158}
159
160/** One card, as the fold shows it. */
161function CardRow(props: { card: Card; onOpen: (source: CardSource) => void }): JSX.Element {

Callers 1

TurnFunction · 0.70

Calls 2

chatFailedFunction · 0.90

Tested by

no test coverage detected