WeKnora/frontend/src/utils
wizardchen d199628701 fix(agent): exclude wiki-only KBs from quick-answer (RAG) mode
Quick-answer agent mode retrieves purely through vector/keyword chunk
search and ships with no `allowed_tools`, so the existing capability
filter (which only reads from `allowed_tools`) let wiki-only KBs through
in every entry point. End result: users could @-mention, select, and
receive suggested questions from wiki-only KBs in quick-answer mode,
but the underlying retrieval always returned empty.

Treat "RAG-only" as an implicit property of `agent_mode = quick-answer`
and union it with the tool-derived filter. The same predicate is now
used everywhere the user can pick or be steered toward a KB:

Backend
- `tools.DeriveKBFilterForAgent` / `KBSatisfiesAgentRequirements`
  layer the implicit quick-answer requirement on top of tool derivation.
- `ListKnowledgeBases`, `SearchKnowledge` (shared-agent `@file`),
  `resolveKnowledgeBasesFromAgent` (chat runtime), `/search` IM command,
  and `GetSuggestedQuestions` now all use the agent-mode-aware variant.
- `GetSuggestedQuestions` also skips the wiki-page fallback for
  quick-answer agents to cover the `selected` / explicit-kb-ids paths
  where a wiki-only KB could still slip through.

Frontend
- `deriveKbFilterForAgent` / `kbSatisfiesAgentRequirements` mirror the
  Go helpers.
- `@` mention dropdown (`Input-field.vue`) uses the new helper.
- Agent editor's "specified KB" picker (`AgentEditorModal.vue`) grays
  out wiki-only KBs for quick-answer agents with a tooltip, and the
  pre-save warning fires for quick-answer mode too.
- i18n: add `agentEditor.agentType.kbMismatch.quickAnswer` across all
  four locales.
2026-05-12 16:27:28 +08:00
..
api-base.ts feat(frontend): respect BASE_URL so the SPA works behind a path-prefix reverse proxy 2026-05-05 00:58:19 +08:00
caret.ts feat: 支持输入框内选择知识库和文件,优化选择交互体验 2025-12-22 13:11:31 +08:00
chatMessageShared.ts feat(i18n): replace hardcoded Chinese strings with i18n calls across frontend 2026-03-06 10:34:08 +08:00
cronHumanize.ts feat(datasource): implement data source management functionality 2026-03-30 20:46:07 +08:00
files.ts fix(frontend): knowledge document list layout, batch bar, and selection 2026-04-29 15:20:41 +08:00
finalAnswer.ts fix(agent): hide trailing thinking event when it duplicates final answer 2026-05-07 17:33:03 +08:00
index.ts feat(video): remove video upload support and update related terminology 2026-04-14 22:59:14 +08:00
mermaidShared.ts fix(frontend): prevent duplicate click binding 2026-03-30 10:46:50 +08:00
mermaidViewer.ts feat(i18n): replace hardcoded Chinese strings with i18n calls across frontend 2026-03-06 10:34:08 +08:00
request.ts feat(request): enhance token refresh handling and public auth request logic 2026-04-15 15:58:01 +08:00
security.ts fix(security): forbid <style> in sanitized document HTML 2026-05-06 16:41:20 +08:00
tdesign-icon-offline.ts fix(frontend): bundle tdesign-icons sprite locally for offline deploys 2026-04-23 18:21:49 +08:00
tool-capabilities.ts fix(agent): exclude wiki-only KBs from quick-answer (RAG) mode 2026-05-12 16:27:28 +08:00
tool-icons.ts feat: friendly display for MCP tool names in frontend (#715) 2026-03-21 10:22:05 +08:00