Commit Graph

975 Commits

Author SHA1 Message Date
mateaix
f9fcf35dc7 chore(memory): backport bundled Mem0 docs source and align plugin code style with repo conventions 2026-07-26 10:56:27 +08:00
Lcos
396cdb175b
feat(memory): add Mem0 as an optional external plugin memory provider
Extend the plugin memory SPI with a three-arg prefetch(agentId, userQuery, ownerKey) default method and forward ownerKey through PluginMemoryBridge, enabling per-owner isolated recall for external providers. Ship mateclaw-plugin-mem0: an optional, zero-extra-dependency plugin that bridges a self-hosted Mem0 service (semantic recall via /memories/search/, async turn sync via /memories/) with full fault isolation — not part of the default stack. Includes 42 tests and bilingual user docs.
2026-07-26 10:52:01 +08:00
mateaix
7fb23e5404 fix(team): fresh event-stream subscriptions deliver live events only, no stale replay 2026-07-26 10:40:17 +08:00
mateaix
b6326daaf8 feat(team): windowed task board — paged terminal columns with true totals and database-side status counts 2026-07-26 10:17:47 +08:00
mateaix
2cbe00a1e7 feat(team): plan-execute leads orchestrate through the task board — hand-off bridge, resume gate and step dependencies 2026-07-25 22:22:38 +08:00
mateaix
c15e51b34b feat(team): collaboration observability — live event channel, task timeline, prerequisite hand-off and readable validation errors 2026-07-25 19:57:57 +08:00
mateaix
251a3288dd feat(team): execution hardening, task deliverables and run transcript visibility 2026-07-25 14:32:49 +08:00
matevip
5e380a1b3c feat(team): admin REST API for teams, membership and the task board 2026-07-24 17:38:23 +08:00
matevip
8fa10e3769 feat(team): team_tasks tool with role gating and team context injection into agent prompts 2026-07-24 17:38:02 +08:00
matevip
86e65beafe feat(team): auto-dispatch assigned tasks to member agents and announce settled results to the lead 2026-07-24 17:37:33 +08:00
matevip
626c3a2fae feat(team): team registry, membership and shared task board with guarded state transitions 2026-07-24 17:37:04 +08:00
matevip
728ed53062 feat(skill): scope agent runtime skill resolution to the conversation workspace 2026-07-24 14:12:08 +08:00
matevip
f715e8ffc0 feat(skill): add workspace-scoped runtime skill resolution overloads 2026-07-24 11:06:37 +08:00
matevip
67301c5f7c feat(skill): scope skill dedup, name uniqueness and reinstall/uninstall lookup by workspace 2026-07-24 10:27:32 +08:00
matevip
c18ff31ae8 feat(skill): scope skill workspace filesystem paths by workspace to isolate same-named skills 2026-07-24 10:26:57 +08:00
matevip
e294b32542 feat(channel): scope conversation ids by channel to stop cross-workspace bleed 2026-07-23 18:50:10 +08:00
matevip
e2747df2c5 feat(channel): /model magic command for per-conversation model switching (restore) 2026-07-23 11:49:28 +08:00
matevip
49f7a74386 fix(approval): persist the real pendingId on guard audit rows 2026-07-23 11:46:22 +08:00
matevip
8174006b01 feat(approval): reject dead grant configurations at creation 2026-07-23 11:46:15 +08:00
matevip
1bb81234d0 feat(approval): classify auto-approve misses and persist the outcome on guard audit rows 2026-07-23 11:44:21 +08:00
mateaix
a4ee953d31 feat(channel): /model magic command for per-conversation model switching 2026-07-22 22:27:34 +08:00
matevip
717f15e91f feat(conversation): rewind-to-message endpoint and duplicate-free regenerate across web, webchat, and console UI 2026-07-22 18:10:28 +08:00
matevip
a183519d69 feat(channel): extract the per-turn stream accumulator and share it between web SSE and IM sync paths 2026-07-22 18:09:59 +08:00
matevip
d999608b2c fix(agent): exclude skill readers from tool-result spill so SKILL.md reaches the model intact 2026-07-22 17:48:45 +08:00
matevip
4ac72a90a0 feat(skill): bundle file management — view and edit scripts, references, and templates from the console
The skill detail drawer could only show and edit SKILL.md; the bundle
files under scripts/ and references/ had no console surface, and
templates/ was readable by agents but absent from the canonical
store's bucket set.

- admin endpoints on /api/v1/skills/{id}/files: list (self-heals an
  empty canonical store from on-disk files), read, upsert, delete.
  Writes update the canonical row, materialize the workspace cache,
  and re-resolve the skill so agents pick changes up immediately.
  Path envelope enforces the three buckets and blocks traversal;
  builtin skill files stay read-only; virtual skills own no files.
- templates/ becomes a first-class DB-persisted bucket shared across
  the syncer, the workspace write/delete envelope, and prune guards.
- the agent-facing write_file action now mirrors into the canonical
  store and re-resolves instead of writing only the local filesystem.
- SkillMarket detail drawer gains a Files tab: grouped list, viewer,
  inline editor, create and delete, refetched on every entry.
2026-07-22 15:39:59 +08:00
matevip
aa0e249ce4 feat(skill): endpoint reachability checks in the skill requirement gate
Skills backed by a network service could show ready while the service
was unreachable from the current deployment (intranet-only address,
wrong network segment) — the failure only surfaced mid-task.

- endpoint requirement type: TCP-connect probe (1.5s timeout) of the
  declared service address; accepts http(s)://host[:port][/path],
  host:port, and bare-host forms
- URL-shaped check targets infer the endpoint type without an explicit
  declaration; unparseable targets report UNKNOWN instead of missing
- probe results cached 60s per host:port so refresh passes stay cheap
  and a VPN connect is picked up within a minute
- unreachable endpoints surface as setup-needed on the skill card,
  pre-flight requirement rows, and the agent-facing catalog
2026-07-22 14:38:37 +08:00
matevip
5e188cd77b feat(skill): single-source SKILL.md — DB canonical, workspace file as tracked cache
The runtime resolved SKILL.md from the workspace directory while the
admin console read the skill_content column, so out-of-band file edits
(agent shell tools in a chat session) changed runtime behavior but never
showed up in the console, and a failed workspace export left agents
executing stale content the console claimed was current.

- SkillContentReconciler: three-way sync between the canonical DB column
  and the convention-workspace file, anchored on a sidecar hash marker.
  File-side edits ingest into the DB, DB-side edits materialize to the
  file, two-sided conflicts resolve DB-wins with a backup.
- Skill detail GET performs a read-time reconcile and triggers a
  single-skill rescan when the file side changed, so a console query is
  always current without waiting for the runtime cache TTL.
- SkillMarket detail drawer refetches the row and runtime status on open
  instead of rendering the page-load list snapshot.
2026-07-22 14:20:27 +08:00
matevip
8a55bdd367 feat(channel): relay per-stage narration as standalone messages on the sync IM path 2026-07-22 14:08:55 +08:00
matevip
8749c915cd feat(wecom): roll progress bubble per stage narration 2026-07-22 13:40:22 +08:00
matevip
3781275e59 feat(llm): smarter failover — overload-aware retries, provider retry windows, provider pool auto-recovery 2026-07-22 11:12:47 +08:00
mateaix
2405c7f3d6 chore: rewrite feishu tool guard card comments as functional descriptions; remove unused wecom media helpers 2026-07-21 21:55:39 +08:00
mateaix
be836b6f0a fix(wecom): harden streaming reply management 2026-07-21 21:48:30 +08:00
matevip
a7fdbceb48 fix(wiki): wiki_disabled agent no longer receives wiki prompt injection 2026-07-21 18:12:37 +08:00
matevip
0ad1371abd refactor(skill): harden bundled-skill DB sync and extend self-heal 2026-07-21 18:12:29 +08:00
rootdeng
02772d58b8
fix(skill): sync builtin skill scripts to DB and self-heal missing workspace scripts
Bundled skill scripts/ and references/ are now persisted to mate_skill_file during startup sync; a workspace missing its scripts directory is force-restored from the classpath bundle even when the SKILL.md version is unchanged; and builtin skills with neither DB rows nor on-disk files backfill from the classpath. Fixes installs performed from builds whose jar shipped without bundle scripts.
2026-07-21 17:56:56 +08:00
matevip
bf6bed5511 feat(wecom): event-driven progress bubble with live tool trace 2026-07-21 10:29:00 +08:00
matevip
beb1a8c243 feat(channel): extensible magic commands (/new /help /status /stop) 2026-07-21 10:28:41 +08:00
jack
1e2b7bbc2c
fix(weixin): send generated files through weixin channel (#543)
Send agent-generated files as native WeChat attachments via the iLink upload flow, and fix the wire protocol for file uploads: dedicated wire ObjectMapper (bypasses the global Long-to-String serializer), md5/len fields and encrypt_type on media items, channel_version 1.0.2, and explicit business-error handling on ret != 0. The weixin adapter now routes generated-file URLs through GeneratedFileScrubber, matching WeCom/Feishu behavior.

Fixes #307
2026-07-20 20:34:59 +08:00
matevip
d10ed9dd06 feat(channel): add clear magic command 2026-07-20 18:21:46 +08:00
matevip
22a61e6e78 feat(wiki): closed relation schema for entity extraction
Entity extraction previously constrained entity types but let the
model freely invent any relation between entities, producing noise
that diluted the entities a knowledge base actually cares about.
Adds an optional per-KB relation schema (subjectType/predicate/
objectType triples): when set, the extraction prompt is scoped to
only those relations, and a hard filter drops anything that slips
through before it is persisted. Empty/unset keeps the existing
open-vocabulary behaviour.
2026-07-16 17:39:41 +08:00
matevip
7a1d237de4 fix(skill): decode zip entry names and content independently to fix mojibake on mixed-encoding archives
Windows-authored zips often store entry names in the local codepage (GBK)
without setting the ZIP UTF-8 flag, while file content stays UTF-8. The
previous fallback decoded the whole archive with one charset, so a single
GBK-named entry forced already-correct UTF-8 content to be re-decoded as
GBK, corrupting valid Chinese text into mojibake. Names and content now
each try UTF-8 first and fall back to GBK independently, per entry.
2026-07-16 14:13:27 +08:00
RobinZhiBin
19bd612c9a
fix(datasource): re-encrypt password on connection test and discover PostgreSQL views 2026-07-15 16:07:53 +08:00
倪程伟
b23cc32f33
fix(wiki): make global starter-pack templates read-only
Global transformation templates (workspace_id IS NULL, e.g. the 7 built-in
starter packs made global by V165) were shared across every workspace but
not actually read-only: any workspace member could edit or delete them,
mutating/affecting all workspaces, with deletes unrecoverable (Flyway
seed runs once).

- Controller: reject update/delete of null-workspace templates with 403
  (err.wiki.global_template_readonly); read/apply paths unchanged.
- Service: defense-in-depth — update/delete also reject global templates,
  guarding non-HTTP callers (WikiTool LLM entry points). delete() now
  checks the entity before deleting instead of deleting blindly.
- findByName: add deterministic ORDER BY (workspace_id IS NULL) ASC so a
  workspace-local template wins over a same-named global one (was LIMIT 1
  with no ordering). Consistent across H2/MySQL/Kingbase.
- i18n: new err.wiki.global_template_readonly (zh + en).
- Tests: +2 controller mock tests (403 on update/delete, no service write),
  +2 E2E tests (global template stays intact; findByName prefers local).

Tests: 10/10 green (4 controller + 6 E2E).
2026-07-15 14:57:18 +08:00
倪程伟
fc3d84d6c2
fix(wiki): budget the system-prompt KB page listing to the model window
buildWikiContext enumerated an agent's bound knowledge-base pages into
the system prompt capped only by maxContextChars (default 10000, sized
for large cloud models). On a small-context model a large KB therefore
consumed a big fixed slice of the window on every turn — the "tool token
estimate fills the context" report in #521 (the growth lands in the
system-prompt bucket, not the tool-schema bucket; wiki tool schemas are
fixed-size and do not scale with file count).

Add a budgeted buildWikiContext(agentId, budgetTokens) overload mirroring
buildRelevantContext: the page enumeration also stops once the estimated
token total exceeds the budget, appending the existing
'... and more (use wiki_list_pages)' hint. AgentGraphBuilder passes the
same prefix budget it already applies to the memory block; the legacy
Integer.MAX_VALUE path keeps chars-only behavior for large models.

Tests cover null-budget (all pages), token-budget truncation, and
zero-budget skip.
2026-07-15 14:52:43 +08:00
倪程伟
bf224abc05
feat(llm): default model discovery by protocol for custom providers + configurable modelsPath
Custom (user-added) providers were hard-coded supportModelDiscovery=false in
createCustomProvider, so self-hosted OpenAI-compatible endpoints (vLLM /
Xinference / LocalAI / gateways) never surfaced the 'discover models' button —
users had to add every model id by hand.

- ModelProtocol: add per-protocol supportsSelfConfiguredDiscovery() + resolve()
  helper (single source of truth for chat-model class and capability flags).
  baseUrl+apiKey protocols (openai-compatible, dashscope-native, gemini-native,
  anthropic-messages) => true; OAuth protocols => false. The flag is deliberately
  narrower than 'can ever discover' (built-in ChatGPT-OAuth still discovers via
  its OAuth session); javadoc warns against reusing it to gate the button.
- createCustomProvider: default supportModelDiscovery from the resolved protocol
  instead of always false. Existing rows are unaffected (no migration).
- OpenAiModelsPath: new single source of truth for the models-listing path,
  honoring an optional 'modelsPath' generateKwargs override (mirrors the existing
  'completionsPath' override) for endpoints behind a reverse proxy / non-standard
  prefix (e.g. /openai/v1/models) that would otherwise 404 on /v1/models.
  Shared by BOTH discovery (ModelDiscoveryService) and the failover liveness
  probe (OpenAiCompatibleListModelsProbe) so an override can't make a provider
  discoverable yet still marked unhealthy by a probe hitting the wrong path.
- Tests: ModelProtocolTest (capability table + resolve fallback), OpenAiModelsPathTest
  (path branch table + vendor cases + modelsPath override), and custom-provider
  discovery-default assertions. Path-resolution coverage consolidated into
  OpenAiModelsPathTest (was split across the discovery + probe test files).
- Docs: zh/en models.md note custom-provider discovery + modelsPath override.

Refs matevip/mateclaw#519
2026-07-15 14:50:53 +08:00
matevip
cd0360ff3f fix(wiki): stabilize concurrent raw-material uploads and PostgreSQL-compatible IDs
Give raw-material uploads a dedicated five-minute timeout and process file-picker and drag/drop uploads through a shared two-worker queue, so constrained uplinks no longer abort multipart requests at the global 30-second deadline.

Switch wiki processing jobs and page citations to application-assigned IDs: the PostgreSQL/Kingbase migrations define plain BIGINT primary keys without identity defaults, so database-generated keys fail on insert.
2026-07-15 14:27:14 +08:00
matevip
e2c3cfd5b4 fix(db): application-assigned ids for entities lacking auto-increment on PostgreSQL-compatible dialects
Eight entities (fact, fact contradiction, morning-card seen, wiki hot
cache / relation / transformation / transformation run / image caption
cache) declared IdType.AUTO while their PostgreSQL-compatible migrations
define the primary key as a plain BIGINT with no identity default.
MyBatis-Plus omits the id column from the generated INSERT under AUTO,
so every insert fails with a NOT NULL violation on those databases —
silently on paths that only log a warning. Switch them to snowflake
ASSIGN_ID, which works on all dialects since auto-increment columns
accept explicit values. Add a parameterized contract test pinning the
id strategy for all eight entities.
2026-07-15 14:26:47 +08:00
matevip
f97624874c chore(ui): add ESLint 9 flat config and fix lint script
The lint script referenced eslint with --ext flags but the repo never had
an ESLint config file, so pnpm lint always failed. Add a flat config
(typescript-eslint recommended + vue essential) with legacy-code rules
downgraded to warnings, drop the flat-config-incompatible --ext flags,
and move pnpm build approvals from the no-longer-read
pnpm.onlyBuiltDependencies field to pnpm-workspace.yaml allowBuilds.
2026-07-15 14:25:59 +08:00
RobinZhiBin
8a6dd1fa67
fix(wiki): stabilize concurrent raw-material uploads and PostgreSQL-compatible IDs
Give raw-material uploads a dedicated five-minute timeout and process file-picker and drag/drop uploads through a shared two-worker queue, so constrained uplinks no longer abort multipart requests at the global 30-second deadline.

Switch wiki processing jobs and page citations to application-assigned IDs: the PostgreSQL/Kingbase migrations define plain BIGINT primary keys without identity defaults, so database-generated keys fail on insert.
2026-07-15 09:51:20 +08:00
matevip
f0dcc44fef feat(workspace): default storage root setting + desktop local-tools whitelist management (#512)
- Settings → System gains a 'default workspace storage path' item: validated
  on save (absolute, creatable), applied immediately without restart, and
  re-applied from the database on startup. Blank clears the override;
  existing data is never migrated.
- Desktop local file/command tools get a renderer settings page (allowed
  directory list with per-row delete, add via native picker, enable toggle,
  tunnel status); the native dialog additionally gains a 'remove directory'
  flow, fixing the whitelist that could only grow.
- System settings save surfaces backend validation errors as a toast.
2026-07-14 18:24:58 +08:00