2195 Commits

Author SHA1 Message Date
zheromiku 6307013085 Merge pull request 'revert(docs): 移除 AGENTS.md —— 改为只在 knowledge-governance 试点' (#2) from revert/agents-pointer into main
Build and Push Docker Image / build-ui (push) Has been cancelled
Build and Push Docker Image / build-docreader (push) Has been cancelled
Build and Push Docker Image / build-sandbox (push) Has been cancelled
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Has been cancelled
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Build and Push Docker Image / merge (push) Has been cancelled
2026-10-10 14:58:55 +08:00
姚章浩 87df5751b7 revert(docs): 移除 AGENTS.md —— 改为只在 knowledge-governance 试点
按指示先把范围收回到单个仓做实验:本仓恢复到加 AGENTS.md 之前的状态,
等试点验收通过再统一铺开。

本提交只删文件,不改任何代码。
2026-10-10 14:58:52 +08:00
zheromiku e19ad4276c Merge pull request 'docs(agents): 加 AGENTS.md 操作手册与规范指针' (#1) from docs/agents-pointer into main
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Has been cancelled
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Build and Push Docker Image / merge (push) Has been cancelled
Build and Push Docker Image / build-ui (push) Has been cancelled
Build and Push Docker Image / build-docreader (push) Has been cancelled
Build and Push Docker Image / build-sandbox (push) Has been cancelled
2026-10-10 14:54:32 +08:00
姚章浩 f5f842b46a docs(agents): 加 AGENTS.md 操作手册与规范指针
本仓此前没有任何 agent 上下文文件,代理每次都得重新讲一遍规范。
新增 AGENTS.md:指向系统级规范(zheromiku/eng-standards-main),并写明
本仓已核实的现状(CI / runner / main 已受分支保护)。

为什么用 AGENTS.md 而不是 .hermes.md:Codex / Claude Code / OpenCode 读的
也是 AGENTS.md,跨工具可移植。
2026-10-10 14:52:18 +08:00
wizardchen 77e4f93e3e Align MCP OAuth and tool approval cards with agent tool timeline UX.
Build and Push Docker Image / build-ui (push) Has been cancelled
Build and Push Docker Image / merge (push) Has been cancelled
Build and Push Docker Image / build-docreader (push) Has been cancelled
Build and Push Docker Image / build-sandbox (push) Has been cancelled
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Has been cancelled
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Unify inline interaction styling with tool steps: timeline icon placement, shimmer pending state, collapsible JSON args, and lighter status rows.
2026-06-29 23:58:38 +08:00
wizardchen b5a1c88f75 fix(mcp): add OAuth skip endpoint and streamline in-chat interaction cards
Add a dedicated cancel route so users can skip mid-conversation OAuth without
token verification, and restyle OAuth/approval cards to match AgentStreamDisplay
with compact inline actions.
2026-06-29 23:22:28 +08:00
wizardchen 505195865a fix(mcp): trigger OAuth prompt during tool registration and dedupe helpers
OAuth authorization was only handled in MCPTool.Execute, so unauthenticated
services failed silently during RegisterMCPTools before any tool reached the
agent. Wire EventBus/session metadata into registration and reuse the same
getOrCreateMCPClientWithOAuthRetry path used at execution time.

Extract MCP OAuth session/wait/connect logic into mcp_oauth.go and remove the
duplicate waitForOAuthAndRetry + RegisterMCPContext layering in mcp_tool.go.
2026-06-29 23:22:28 +08:00
wizardchen 9fd7a7f522 feat(mcp): prompt and resume OAuth authorization mid-conversation
When an agent invokes an OAuth-enabled MCP service that the current user has
not authorized yet, the tool call now pauses and surfaces an "Authorize" card
in the chat instead of failing with an opaque error. After the user completes
the per-user OAuth popup, the backend verifies a token exists and resumes the
paused tool call automatically.

Backend:
- Add mcp_oauth_required / mcp_oauth_resolved events and response types.
- Add OAuthPendingRequest + Gate.RequestOAuthAndWait, reusing the existing
  approval waiter, Resolve, Redis cross-instance fan-out and timeout.
- MCPTool.Execute pauses on an authorization-required error for OAuth services
  and retries once (with a fresh ctx and recycled connection) after the user
  authorizes.
- Forward the new events to the SSE stream.
- Add ResolveMCPOAuth handler + route; it verifies authorization before
  unblocking so a premature resolve cannot resume into another failure.

Frontend:
- Add McpOAuthCard with an Authorize button reusing the popup + status-poll
  flow, then resolve the paused run.
- Handle the new stream events (dedup multiple pending cards per service).
- Add resolveMCPOAuth API client and i18n keys (zh/en/ko/ru).
2026-06-29 23:22:28 +08:00
wizardchen f2686e9e39 feat(mcp): drive auth by AuthType and auto-detect OAuth on test
Select the auth header for the configured strategy only, instead of
emitting both X-API-Key and Authorization whenever the fields happened
to be set (which double-authed after switching strategies). AuthType=""
keeps the legacy infer-from-fields behavior for pre-existing rows.

Add a configurable api_key_header (non-secret, defaults to X-API-Key) so
services expecting the key in a different header work without plaintext
custom headers.

On connection test, upgrade a bare 401 that advertises RFC 9728
protected-resource metadata into an explicit OAuthRequired signal so the
UI can guide the user to switch to OAuth 2.0. Surface the server's
description from the initialize handshake in the test result.
2026-06-29 22:37:52 +08:00
wizardchen c29761331c fix(agent): enforce tag scopes across knowledge tools 2026-06-29 19:17:42 +08:00
wizardchen 17ffd902ac fix(agent): avoid expanding tag scopes for grep chunks 2026-06-29 19:17:42 +08:00
wizardchen d3071fbe03 test(agent): add unit tests for buildMustUseBlock functionality
- Introduced tests for buildMustUseBlock to validate multi-word service prefix handling and name sanitization.
- Ensured that service names are correctly sanitized to prevent newline injection in must_use blocks.
- Verified that the generated block includes the correct tool name prefixes and does not contain unwanted characters.
2026-06-29 18:09:44 +08:00
wizardchen 6ad75d19fd test(knowledge): unbreak service test package after tag-loading change
Fixing the knowledge_create_test compile error in this branch let the
internal/application/service test package run for the first time, which
exposed two latent failures introduced when GetKnowledgeByID started
eagerly loading tags:

- GetOwningKBCreatorID went through the service-level GetKnowledgeByID
  (which now calls repo.GetKnowledgeTags); ownership resolution only
  needs the knowledge -> kb_id link, so resolve via repo.GetKnowledgeByID
  directly (tenant-scoped) and drop the extra tag query.
- createKnowledgeFileRepoStub lacked GetKnowledgeTags, which the create
  path always invokes via setAndAttachKnowledgeTags; add the stub method.
2026-06-29 18:09:44 +08:00
wizardchen d24e830c85 refactor(agent): fix grep scope loss and consolidate per-turn @mention scoping
- Fix grep_chunks dropping the full-KB scope when a turn mixes @KB with
  @tag/@file: extract scopeClause and OR knowledge-ID and (kb,tenant)
  predicates together, matching knowledge_search's fan-out.
- Consolidate the three scattered per-request @Skill/@MCP scope blocks in
  buildAgentConfig into applyPerRequestSkillScope / applyPerRequestMCPScope,
  each narrowing the whitelist and computing the must_use pin in one place.
- Dedupe the two identical selection-mode normalizers in Input-field.vue.
- Fix knowledge_create_test passing "" for the tagIDs []string parameter,
  which made the whole service test package fail to compile.
- Add unit tests for scopeClause and the per-request scope helpers.
2026-06-29 18:09:44 +08:00
wizardchen b86efe3f92 fix(agent): harden @mention scope and simplify must_use hints
Tighten per-turn @MCP/@Skill/@tag handling after review: enforce agent
MCP/Skill whitelist, ignore mentions when selection mode is none, tag-scope
grep_chunks, and simplified English must_use lines without tool dumps.
Skip persisting scope envelopes to history rendered_content.
2026-06-29 18:09:44 +08:00
wizardchen 049f85139d feat(chat): add @Skill/@MCP mentions with scoped agent runtime
Wire per-turn @mentions for skills, MCP services, tags, and files through
QA handlers into agent config, runtime_context/must_use user blocks, and
tool registration. Fix tag-only scopes dropping KB tools, refresh suggested
questions on mention changes, and strengthen MCP must_use so @selected
services are invoked before local KB search.
2026-06-29 18:09:44 +08:00
wizardchen 40f217c228 test: fix stale Doris SQL-shape and flaky OSS bucket assertions
Two pre-existing test failures on main, unrelated to any feature change:

- Doris VectorRetrieve/KeywordsRetrieve inline LIMIT as a literal (Doris
  does not support placeholders for LIMIT/OFFSET), but the SQL-shape tests
  still expected `LIMIT ?` with TopK as a bound arg. Match the literal
  LIMIT and drop the extra argument.
- TestOssEnsureBucket_CreateFails used the bucket name "test-bucket",
  which already exists globally on OSS, so IsBucketExist short-circuited
  and the create path never ran. Use a non-existent bucket name so the
  create-with-invalid-credentials path is actually exercised.
2026-06-29 17:44:56 +08:00
Binks Riverton af432c5e06 fix: make infrastructure host/port configurable via env vars in docker-compose
Replace 7 hardcoded service host/port values with environment variable
references that preserve the existing defaults, so users can override them
via .env to connect to external infrastructure (DB, Redis, Qdrant, Milvus,
Neo4j) without editing docker-compose.yml.

- DB_DRIVER, DB_HOST, DB_PORT
- QDRANT_HOST
- MILVUS_ADDRESS
- REDIS_ADDR
- NEO4J_URI
2026-06-29 17:27:32 +08:00
wizardchen ea84b7b983 feat(frontend): show stacked integration icons on sidebar hover
Add a compact stacked icon preview when hovering the Publish & Integrations
menu item so users can see available channels before opening the page.
Centralize integration tab metadata in config for easier future additions.
2026-06-29 11:08:29 +08:00
Binks Riverton 7d8a80ae8d fix(frontend): reposition card hover popover to card instead of cursor
Change the knowledge card hover popover from following the mouse to being
anchored to the card element with smart boundary detection. Try positioning
in order: right, left, bottom, and top of the card, automatically avoiding
viewport edges. Also add CSS hints (will-change, backface-visibility,
translateZ) to prevent popover content jitter.
2026-06-28 00:32:01 +08:00
wizardchen 8285188501 feat(frontend): add Chrome extension and Claw Skill integration landing pages
Move Chrome extension and Claw Skill entries from the user menu into the
integrations center with dedicated landing tabs, setup steps, and lobster-themed Claw styling.
2026-06-28 00:31:38 +08:00
wizardchen 16e24cfc95 ui(frontend): polish channel cards and use official QQBot icon
Replace the placeholder QQBot logo with the official documentation favicon and enlarge channel card badges for clearer platform recognition.
2026-06-27 16:55:37 +08:00
wizardchen 6b60d292f8 fix(embedding): add SSRF validation and safe HTTP client for embedders
Align embedding outbound requests with chat module defenses by validating
base URLs at construction time and using SSRFSafeDialContext with redirect checks.
2026-06-26 22:41:04 +08:00
wizardchen 500b223acf chore: bump version to 0.6.3 2026-06-26 22:24:29 +08:00
wizardchen 4588e95ba3 fix(frontend): hide redundant card badges when section headers apply
Suppress duplicate origin, builtin, role, and org-name pills on knowledge
base, agent, and organization list cards when the visible group header or
sidebar filter already conveys the same information.
2026-06-26 16:55:44 +08:00
YS-zdck b8ce6a699c feat(im): 新增QQBot即时通讯平台集成支持
完整实现QQBot的IM适配器功能,包括客户端封装、WebSocket长连接管理、消息收发与事件解析;更新后端合法平台校验列表与适配器注册配置;补充前端平台选型选项、logo资源、多语言文案以及渠道配置表单,同时添加对应的单元测试。
2026-06-26 16:53:00 +08:00
wizardchen 974ca359e5 docs: release v0.6.3 notes and polish architecture diagram
Add 0.6.3 changelog and version bumps, extend QA/README coverage for
recent features, simplify intelligent-reasoning feature blurbs, and
refresh the architecture diagram (embed widget, lobster ClawHub icon).
2026-06-26 14:59:09 +08:00
wizardchen 6932c3a85d feat(embed): always show channel key via detail API
Fetch publish tokens when opening an embed channel drawer so deploy snippets
stay available after browser restarts, while list endpoints still omit secrets.
2026-06-26 14:55:39 +08:00
wizardchen ecaedf1196 feat(frontend): unify document tag filter, manage drawer, and detail UX
Split tag filtering from CRUD management on the knowledge base document
page, align copy to "tags" across locales, and polish hover/detail surfaces
with setting-drawer section styling. Return tags from GetKnowledge for the
detail drawer.
2026-06-26 12:26:29 +08:00
wizardchen 96ac1a17a1 feat(frontend): redesign tag sidebar chips and tag edit dialog
Compact chip sidebar with single-select filter, document counts, context-menu
actions, and refreshed TagEditDialog with selected/available sections. Add i18n,
component tests, and exclude soft-deleted rows from multi-tag migration backfill.
2026-06-26 10:52:52 +08:00
wizardchen 2f29054110 fix(knowledge): harden multi-tag data integrity and UX follow-ups
Clear tag relations on move/delete, validate tags on create, batch-load tags,
restore KB-scoped reference counts, dedupe SetKnowledgeTags, fix filter
double-fetch and ResizeObserver leaks, and regenerate Swagger for tag_ids.
2026-06-26 10:52:52 +08:00
Anky c007a897cf feat: support multi-tag for document knowledge (#1790)
* feat: support multi-tag for document knowledge

- Add knowledge_tag_relations join table for many-to-many tag-knowledge mapping
- Migrate existing single tag_id data to the new table
- Update Knowledge struct, filter, payload types (TagID -> Tags/TagIDs)
- Rewrite repository layer: SetKnowledgeTags, GetKnowledgeTags, ListIDsByTagIDs
- Update tag count references to query knowledge_tag_relations
- Update service/handler layers for multi-tag create/list/batch-update
- Frontend: multi-select tag sidebar, multi-tag chip display, tag toggle in popup
- FAQ tags remain single-tag model (unchanged)

* feat(knowledge): tag edit dialog with dynamic overflow and inline creation

- Add TagEditDialog component with search, multi-select, and confirm
- Replace inline t-popup tag selector with dialog-based editing
- Tags overflow with +N badge, visible count adapts to container width via ResizeObserver
- Date/card layout: fixed date width, tags flex to fill remaining space
- Add persistent new-tag input bar in dialog (Enter to create, auto-select)
- Tag creation emits callback to refresh parent tag list immediately
- Apply same overflow + dialog trigger to both card view and list view
- Add i18n keys: tagEditDialogTitle, tagEditSearch, tagSelectedCount, tagOverflowTip, tagNewPlaceholder

* fix: exclude soft-deleted knowledge from tag reference counts

CountReferences, BatchCountReferences, and DeleteUnusedTags now
JOIN with knowledges table to filter out soft-deleted records
when counting knowledge_tag_relations. Previously they queried
knowledge_tag_relations directly without the deleted_at check,
causing stale tag counts after knowledge deletion.

* fix: refresh tag counts after async knowledge deletion completes

Add a second delayed tag list refresh (2.5s) after tag deletion to capture
updated reference counts for remaining tags. The original immediate refresh
handles removing the deleted tag from the list, while this delayed refresh
ensures other tags' counts are correct after the async deletion finishes.

---------

Co-authored-by: lyingbug <xiayula2014@gmail.com>
2026-06-26 00:18:48 +08:00
wizardchen 5c0e97c12e fix(frontend): refresh batch reparse UI after async task enqueue
Optimistically mark submitted documents as pending and poll until the worker
updates the backend, preventing a stale completed state after list reload.
2026-06-25 23:57:54 +08:00
wizardchen 97b7bb9890 fix(knowledge): harden batch reparse UX and async processing
Move batch reparse work to an asynq task to avoid HTTP timeouts, add i18n
for all locales, guard in-flight documents, and prevent concurrent delete/reparse.
2026-06-25 23:57:54 +08:00
jw_mac a14c1d87aa feat(knowledge): add batch reparse capability
This commit introduces the Batch Reparse feature for the Knowledge Base.
Users can now select multiple documents and trigger a re-parsing pipeline in batches, streamlining the recovery from parse failures.
2026-06-25 23:43:27 +08:00
wizardchen 5f2ca6c975 fix(agent): reconcile agent stream mode and shared-agent readiness UX
Derive stream pipeline from selectedAgentId to fix quick-answer/isAgentEnabled drift, gate configure actions for shared agents, and polish selector detail panel positioning.
2026-06-25 23:33:39 +08:00
wizardchen 47478491c9 fix(agent): address readiness review findings
Tighten shared-agent readiness checks, surface not-ready toasts in the
selector, validate chat-model overrides in resolveChatModelID, and
improve configure deep-links for shared agents.
2026-06-25 23:33:39 +08:00
wizardchen 9ca4e1f23a feat(agent): enforce model readiness and polish selector UX
Block chat when agents lack an explicit chat or rerank model, guide users
through the selector and editor with field highlight, and align session QA
checks with the same readiness rules on backend and frontend.
2026-06-25 23:33:39 +08:00
wizardchen 1e16834d27 fix(frontend): reflect PDF scanned parsing in upload overview
Show the force-scanned mode in the parser summary line when enabled for
builtin PDF uploads, and add missing ko-KR/ru-RU i18n strings for the toggle.
2026-06-25 17:36:18 +08:00
杨聪聪 917feceb59 feat(docreader): support forcing PDF scanned-page OCR parsing 2026-06-25 17:30:22 +08:00
wizardchen 2c44a41f2a feat(models): add model test debugger for saved model configs
Let admins send real requests against configured chat, embedding, rerank,
VLM, and ASR models from settings, with thinking controls shown only when
the model supports them.
2026-06-25 17:05:33 +08:00
wizardchen 122408b283 feat(chat): unify resource chips and browse recent files in @ mention
Add recent=true to knowledge search so the mention picker can list recent
files without a keyword, and consolidate KB/FAQ/file chip styling across
chat input and message history.
2026-06-24 20:58:16 +08:00
wizardchen babe3f2315 fix(integrations): polish agent filter UX and embed session rebind
Add compact agent filter beside channel list titles with selected name
display, fix embed localStorage agentId read on rebind, add IM agent
rebind tests, and deep-link agent editor counts to the matching tab.
2026-06-24 20:09:19 +08:00
wizardchen ec5c3ac638 fix(frontend): polish integration channel card actions
Align add-card height with channel cards, show actions on hover,
and replace delete dialogs with in-place popconfirm like model settings.
2026-06-24 20:09:19 +08:00
wizardchen 635d7c9643 feat(integrations): polish embed/IM channel editors and agent rebind
Align embed channel setup with a step wizard, simplify deploy layout,
and allow changing bound agents on update for embed and IM channels.
2026-06-24 20:09:19 +08:00
wizardchen 2d6d1e3275 fix(frontend): correct integrations redirect tab and lazy-load panels
Map legacy section=integrations to tab=im instead of an invalid tab value,
and mount only the active IntegrationsModal tab to avoid duplicate API calls.
2026-06-24 20:09:19 +08:00
wizardchen 314b2a035c feat(frontend): add publish integrations center and streamline agent editor
Move IM and web embed channel management into a dedicated sidebar entry,
remove the user-menu IM overview submenu, and show a lightweight publish
channel status row in the agent editor basic settings instead of full panels.
2026-06-24 20:09:19 +08:00
zhouxun 4db727ac69 fix(excel): filter out image function strings from parsed content
WPS embeds images in cells using =DISPIMG("ID",mode) which may appear as plain text prefixed with "_xlfn." when processed by openpyxl. These function strings pollute the RAG-indexed document content, causing incorrect AI recall.

Add a regex filter (_is_image_function) that detects _xlfn.DISPIMG(...) and _xlfn.IMAGE(...) patterns and excludes them during row processing in ExcelParser.parse_into_text().

Refs: https://github.com/Tencent/WeKnora/issues/1779
2026-06-24 14:35:37 +08:00
wizardchen fa8e2bb087 fix(web-search): improve SearXNG test connection error messages
Return provider-specific diagnostics when connectivity tests return zero
results, including SearXNG unresponsive_engines details instead of a
misleading API key hint.
2026-06-24 14:28:49 +08:00
wizardchen 8242b6f298 refactor(frontend): update WeCom icon and styles in IM components
Replaced the WeCom SVG icon with a new design and updated the associated styles in the IMChannelPanel and SessionSourceFilter components to reflect the new color scheme. Adjusted layout properties for better responsiveness and visual consistency across the application.
2026-06-24 11:01:56 +08:00