feat: harden support, localize knowledge and add operator availability [skip ci]

Source-only publication of reviewed commit 64e96a7f423673dc29ad56485be9fc79bce8af1c.

Passed in isolation: focused frontend/backend tests, race checks, TypeScript typecheck, lint, Go compilation, Flowgram build, and deterministic SDK build/tests.

Not accepted as a production release: Next.js export/native assembly remains blocked by environment memory limits; browser interaction and MySQL staging acceptance remain unverified. No production server, database/schema, runtime configuration, deployment, release tag, or workflow execution was performed.

Expected source tree: 0a4a7528e9.
This commit is contained in:
2026-10-16 15:21:42 +00:00
parent 299ea50fb5
commit 2f7a491666
176 changed files with 11869 additions and 2716 deletions

View File

@@ -1,3 +1,4 @@
// Modified in the independent AgentDesk fork: localized knowledge workflows and safe display errors.
"use client";
import { useState } from "react";
@@ -145,7 +146,7 @@ export function DebugPanel({ knowledgeBaseId }: DebugPanelProps) {
{getKnowledgeAnswerStatusLabel(answerResult.answerStatus, answerResult.answerStatusName, t)}
</Badge>
<span className="text-xs text-muted-foreground">
{answerResult.latencyMs}ms · {answerResult.modelName || "fallback"}
{answerResult.latencyMs}ms · {answerResult.modelName || t("knowledge.answerFallback")}
</span>
</div>
<div className="rounded-md border bg-background p-3 whitespace-pre-wrap">
@@ -161,12 +162,12 @@ export function DebugPanel({ knowledgeBaseId }: DebugPanelProps) {
>
<div className="flex items-center justify-between gap-2">
<div className="truncate text-xs font-medium">
{getSearchResultLabel(citation)}
{getSearchResultLabel(citation, t)}
</div>
<Badge variant="outline">{citation.score.toFixed(4)}</Badge>
</div>
<div className="mt-1 text-xs text-muted-foreground">
{citation.sectionPath || citation.title || `Chunk #${citation.chunkNo}`}
{citation.sectionPath || citation.title || t("knowledge.chunkNumber", { number: citation.chunkNo })}
</div>
<div className="mt-2 text-xs leading-5 text-muted-foreground whitespace-pre-wrap">
{citation.snippet}
@@ -192,12 +193,12 @@ export function DebugPanel({ knowledgeBaseId }: DebugPanelProps) {
<div key={`${item.chunkId}-${item.documentId}`} className="rounded-md border bg-background p-3">
<div className="flex items-center justify-between gap-2">
<div className="truncate text-sm font-medium">
{getSearchResultLabel(item)}
{getSearchResultLabel(item, t)}
</div>
<Badge variant="outline">{item.score.toFixed(4)}</Badge>
</div>
<div className="mt-1 text-xs text-muted-foreground">
{item.sectionPath || item.title || `Chunk #${item.chunkNo}`}
{item.sectionPath || item.title || t("knowledge.chunkNumber", { number: item.chunkNo })}
</div>
<div className="mt-2 text-xs leading-5 text-muted-foreground whitespace-pre-wrap">
{item.content}
@@ -218,7 +219,7 @@ function getSearchResultLabel(item: {
faqId?: number
documentTitle?: string
documentId?: number
}) {
}, t: (key: string, values?: Record<string, string | number>) => string) {
if (item.faqQuestion) {
return item.faqQuestion
}
@@ -226,7 +227,7 @@ function getSearchResultLabel(item: {
return item.documentTitle
}
if (item.faqId && item.faqId > 0) {
return `FAQ ${item.faqId}`
return t("knowledge.faqNumber", { number: item.faqId })
}
return `Document ${item.documentId ?? 0}`
return t("knowledge.documentNumber", { number: item.documentId ?? 0 })
}