fix: metadata type assertion for TS strict mode
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ export function MessageItem({ message, replyTarget, onReply }: Props) {
|
|||||||
const isAgent = message.user.role === "agent";
|
const isAgent = message.user.role === "agent";
|
||||||
const isDeleted = !!message.deleted_at;
|
const isDeleted = !!message.deleted_at;
|
||||||
const cfg = TYPE_CONFIG[message.type] || TYPE_CONFIG.text;
|
const cfg = TYPE_CONFIG[message.type] || TYPE_CONFIG.text;
|
||||||
const meta = message.metadata as Record<string, unknown> | null;
|
const meta = message.metadata as Record<string, string> | null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -127,12 +127,12 @@ export function MessageItem({ message, replyTarget, onReply }: Props) {
|
|||||||
{/* Agent metadata strip */}
|
{/* Agent metadata strip */}
|
||||||
{meta && isAgent && (
|
{meta && isAgent && (
|
||||||
<div className="mt-1 flex gap-3 text-[10px] text-muted-foreground opacity-50">
|
<div className="mt-1 flex gap-3 text-[10px] text-muted-foreground opacity-50">
|
||||||
{meta.model && <span>{String(meta.model)}</span>}
|
{meta.model && <span>{meta.model}</span>}
|
||||||
{meta.hostname && <span>{String(meta.hostname)}</span>}
|
{meta.hostname && <span>{meta.hostname}</span>}
|
||||||
{meta.cwd && <span>{String(meta.cwd)}</span>}
|
{meta.cwd && <span>{meta.cwd}</span>}
|
||||||
{meta.skill && (
|
{meta.skill && (
|
||||||
<span className="text-[var(--color-msg-plan)]">
|
<span className="text-[var(--color-msg-plan)]">
|
||||||
{String(meta.skill)}
|
{meta.skill}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user