mateclaw/mateclaw-server/src/main/java/vip/mate/agent
lichuan bd02734d61 feat(agent): add knowledge base binding tab to agent editor (#237)
Agents now have a per-agent primary wiki KB stored on
mate_agent.primary_kb_id. KBs remain workspace-shared — selecting one in
the agent editor only chooses the default wiki target for that agent, it
does not change the KB's ownership or visibility.

Backend
- AgentEntity: add primary_kb_id field (FieldStrategy.ALWAYS so the UI
  can clear it back to "no primary")
- AgentController#update: switch body to Map<String, Object> so we can
  tell "field missing" apart from "explicit null" via containsKey, then
  convertValue back to AgentEntity
- WikiKnowledgeBaseService:
  - new resolvePrimaryKb(agentId): prefers agent.primary_kb_id when it
    points to a workspace-visible KB; falls back to legacy
    kb.agent_id marker, then to most-recently-updated workspace KB
  - listByAgentId now returns the full workspace set (KBs are
    workspace-shared under the new model)
  - update(id, name, description) no longer touches agent_id
- WikiController: new GET /knowledge-bases/bindable for the UI picker;
  PUT /knowledge-bases/{id} no longer reads agentId
- WikiKnowledgeBaseEntity: add FieldStrategy.ALWAYS on embeddingModelId
  and configContent so explicit nulls actually unbind/clear instead of
  being silently skipped by MyBatis-Plus's NOT_NULL default
- Migrations V129 (H2 + MySQL): add primary_kb_id column + index, backfill
  from legacy kb.agent_id, MySQL uses INFORMATION_SCHEMA guard +
  PREPARE/EXECUTE for idempotency
- WikiKnowledgeBaseServiceTest: 13 cases, all passing

Frontend
- Agents.vue: new "Knowledge Base" tab, radio-select bindable KBs
- API: listBindableKBs() + Agent.primaryKbId typed string | number | null
- IDs handled as strings throughout (Snowflake-safe)
- i18n keys for the new tab in zh-CN and en-US
2026-05-29 06:00:52 +08:00
..
binding fix(agent): deny skill-discovery tools when skillsDisabled (#184 follow-up) 2026-05-26 22:16:51 +08:00
context fix(agent): replace per-loop head/tail trim with anchored token-budget budgeter 2026-05-26 07:34:25 +08:00
controller feat(agent): add knowledge base binding tab to agent editor (#237) 2026-05-29 06:00:52 +08:00
delegation feat(agent,ui): multi-level subagent delegation tree 2026-05-22 13:44:01 +08:00
event feat(agent,trigger): wire agent_lifecycle as a real event source 2026-05-08 15:07:18 +08:00
graph feat(approval): grant-based auto-approve with safety floor and resolution log 2026-05-27 14:07:39 +08:00
model feat(agent): add knowledge base binding tab to agent editor (#237) 2026-05-29 06:00:52 +08:00
progress feat(agent): inject stale-ledger reminder when the model stops updating 2026-05-24 23:00:35 +08:00
prompt refactor(prompt): clean up prompt corpus, fix summary_budget bug, route fallbacks through i18n 2026-04-19 09:02:37 +08:00
repository Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00
runtime feat(agent,ui): multi-level subagent delegation tree 2026-05-22 13:44:01 +08:00
service refactor(agent): tighten template pre-binding contract and prune product-assistant skills 2026-05-12 07:11:29 +08:00
vo feat(agent,llm): multimodal sidecar routing for unsupported attachments (#87) 2026-05-09 16:41:26 +08:00
AgentAuthoringTool.java feat(agent): digital-employee builder skill to auto-create agents and chain them into a workflow (#165) 2026-05-21 16:26:04 +08:00
AgentGraphBuilder.java feat(approval): grant-based auto-approve with safety floor and resolution log 2026-05-27 14:07:39 +08:00
AgentService.java feat(conversation): introduce ChatResult to carry token usage through sync chat paths 2026-05-25 21:15:53 +08:00
AgentState.java Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00
AgentToolSet.java feat(tool,skill,ui): progressive tool/skill disclosure (load_skill + enable_tool + tier UI) 2026-05-23 09:07:45 +08:00
BaseAgent.java chore(agent): raise default max_iterations 100 -> 150 2026-05-24 23:00:42 +08:00
GraphEventPublisher.java feat(agent,ui): recovery affordance card for non-transient LLM errors 2026-05-10 19:15:57 +08:00
StructuredStreamCapable.java Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00