27 Commits

Author SHA1 Message Date
Arvin Xu
44e4f6e4b0 ️ perf: optimize tool system prompt — remove duplicate APIs, simplify XML tags (#13041)
* 💄 style: remove platform-specific Spotlight reference from searchLocalFiles

Replace "using Spotlight (macOS) or native search" with "using native search"
since the actual search implementation is platform-dependent and the LLM
doesn't need to know the specific backend.

Fixes LOBE-5778

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* ️ perf: remove duplicate API descriptions from tool system prompt

API identifiers and descriptions are already in the tools schema passed
via the API tools parameter. Repeating them in the system prompt wastes
tokens. Now only tools with systemRole (usage instructions) are injected.

Also rename XML tags: plugins→tools, collection→tool,
collection.instructions→tool.instructions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 💄 style: inject tool description when no systemRole instead of skipping

Tools without systemRole now show their description as <tool> children.
Tools with systemRole use <tool.instructions> wrapper as before.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 💄 style: always emit <tool> tag, fallback to "no description"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* update tools

* fix

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 02:01:05 +08:00
Arvin Xu
9bdc3b0474 feat: improve agent context injection (skills discovery, device optimization, prompt cleanup) (#13021)
*  feat: inject all installed skills into <available_skills> for AI discovery

Previously, only skills explicitly added to the agent's plugins list appeared
in <available_skills>. Now all installed skills are exposed so the AI can
discover and activate them via activateSkill.

Changes:
- Frontend: use getAllSkills() instead of getEnabledSkills(plugins)
- Backend: pass skillMetas through createOperation → RuntimeExecutors → serverMessagesEngine
- Add skillsConfig support to serverMessagesEngine

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🐛 fix: use DB + builtin skills for available_skills instead of provider manifests

lobehubSkillManifests are tool provider manifests (per-provider, containing
tool APIs), not skill metadata. Using them for <available_skills> incorrectly
showed provider names (e.g. "Arvin Xu") as skills.

Now fetches actual skills from AgentSkillModel (DB) + builtinSkills for correct
<available_skills> injection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 💄 style: use XML structure for online-devices in system prompt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* ♻️ refactor: extract online-devices prompt to @lobechat/prompts package

Move device XML prompt generation from builtin-tool-remote-device into
the shared prompts package for reusability and consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

*  test: add failing tests for Remote Device suppression when auto-activated

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* ️ perf: suppress Remote Device tool when device is auto-activated

When a device is auto-activated (single device in IM/Bot or bound device),
the Remote Device management tool (listOnlineDevices, activateDevice) is
unnecessary — saves ~500 tokens of system prompt + 2 tool functions.

- Add autoActivated flag to deviceContext
- Move activeDeviceId computation before tool engine creation
- Disable Remote Device in enableChecker when autoActivated

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* update system role

* update system role

* ♻️ refactor: use agentId instead of slug for OpenAPI responses model field

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🐛 fix: use JSON round-trip instead of structuredClone in InMemoryAgentStateManager

structuredClone fails with DataCloneError when state contains non-cloneable
objects like DOM ErrorEvent (from Neon DB WebSocket errors).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🐛 fix: only inject available_skills when tools are enabled

Restore plugins guard to prevent skills injection when tool use is
disabled (plugins is undefined), fixing 28 test failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

*  test: update system message assertions for skills injection

Use stringContaining instead of exact match for system message content,
since available_skills may now be appended after the date.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 00:35:18 +08:00
YuTengjing
c1521d2aeb 💄 style: batch fix eslint violations across packages (#12601) 2026-03-03 02:19:50 +08:00
Innei
c4d85d100c ⬆️ chore(deps): migrate @lobehub/ui to base-ui exports (#12587)
* ⬆️ chore(deps): migrate @lobehub/ui to base-ui exports

- Migrate LobeSelect → Select from @lobehub/ui/base-ui
- Migrate LobeSwitch → Switch from @lobehub/ui/base-ui
- Fix DropdownItem import (use main package instead of internal path)
- Add initialWidth, popupWidth support to ModelSelect

Made-with: Cursor

* ⬆️ chore(deps): update @lobehub packages to latest versions

- Upgrade @lobehub/charts to ^5.0.0
- Upgrade @lobehub/editor to ^4.0.0
- Upgrade @lobehub/icons to ^5.0.0
- Upgrade @lobehub/market-sdk to ^0.31.1
- Upgrade @lobehub/tts to ^5.0.0
- Upgrade @lobehub/ui to ^5.0.0 across multiple packages
- Update peer dependencies for various packages to align with new @lobehub/ui version

Made-with: Cursor
Signed-off-by: Innei <tukon479@gmail.com>

* ⬆️ chore(deps): update @lobehub/tts to version 5.1.2

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-03-02 22:40:46 +08:00
Innei
1f1c49fc52 🐛 fix(tool-ui): fix icon margin and text overflow in FilePathDisplay (#12331)
* 🐛 fix(tool-ui): fix icon margin and text overflow in FilePathDisplay

Fixes LOBE-2541

* 🐛 fix(DragUploadZone): remove border-radius from upload overlay
2026-02-16 21:02:20 +08:00
Innei
79e146f1a3 🐛 fix: improve RunCommand copy button visibility and ActionBar border radius (#12280)
Closes LOBE-4402
2026-02-12 16:01:44 +08:00
Innei
a33cf6c8c6 update 2026-02-11 13:12:34 +08:00
Rdmclin2
e4495946d9 feat: add built in skills management (#12106)
* feat: add builtin skills to skillstore

* feat: add builtin skills management and detail display

* chore: update i18n files

* fix: lobehub skill store uninstall icon

* chore: add want more application for lobehub skills

* fix: tool related test case

* fix: lint error

* chore: update i18n files

* fix: new users no built-in tool list avaliable

* chore: uninstalled builtin tools hidden from agent profile editor

* fix: skill store lost

* chore: use univeral error message

* chore: update built in description and readme

* chore: update i18n files

* chore: update i18n files
2026-02-11 13:05:15 +08:00
Innei
aaa7b6d153 feat(desktop): implement subscription pages embedding with webview (#12114)
*  feat(desktop): implement subscription pages embedding with webview

- Add SubscriptionIframeWrapper component for embedding subscription pages in Electron webview
- Replace compile-time ENABLE_BUSINESS_FEATURES with runtime serverConfigSelectors
- Add useIsCloudActive hook to detect cloud sync status
- Add setupSubscriptionWebviewSession service for webview session management

Resolves LOBE-4589

*  feat: enhance SubscriptionIframeWrapper for improved configuration

- Updated iframe URL to use OFFICIAL_URL for better maintainability.
- Integrated server configuration to conditionally enable business features.
- Cleaned up code by removing commented-out lines and unnecessary eslint suppressions.

This update improves the flexibility and readability of the SubscriptionIframeWrapper component.

Signed-off-by: Innei <tukon479@gmail.com>

*  feat: enhance link interception in SubscriptionIframeWrapper

- Updated the script to intercept both link clicks and window.open calls for better URL handling.
- Added functionality to resolve relative URLs to absolute before logging.

This improvement enhances the tracking of external link interactions within the iframe.

Signed-off-by: Innei <tukon479@gmail.com>

* 🔧 chore: clean up useIsCloudActive hook

- Removed unnecessary eslint suppressions related to react-hooks rules.
- Improved code readability by eliminating commented-out lines.

This update enhances the clarity and maintainability of the useIsCloudActive hook.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-02-11 13:05:10 +08:00
Innei
fcdaf9d814 🔧 chore: update eslint v2 configuration and suppressions (#12133)
* v2 init

* chore: update eslint suppressions and package dependencies

- Removed several eslint suppressions related to array sorting and reversing from eslint-suppressions.json to clean up the configuration.
- Updated @lobehub/lint package version from 2.0.0-beta.6 to 2.0.0-beta.7 in package.json for improvements and bug fixes.
- Made minor formatting adjustments in vitest.config.mts and various SKILL.md files for better readability and consistency.

Signed-off-by: Innei <tukon479@gmail.com>

* fix: clean up import statements and formatting

- Removed unnecessary whitespace in replaceComponentImports.ts for improved readability.
- Standardized import statements in contextEngineering.ts and createAgentExecutors.ts by adding missing spaces for consistency.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update eslint suppressions and clean up code formatting

* 🐛 fix: use vi.hoisted for mock variable initialization

Fix TDZ error in persona service test by using vi.hoisted() to ensure
mock variables are available when vi.mock factory runs.

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-02-11 13:04:48 +08:00
Innei
9ecca13388 refactor: replace react-diff-view with @lobehub/ui CodeDiff (#12077)
* refactor: replace react-diff-view with @lobehub/ui CodeDiff

- Replace react-diff-view with @lobehub/ui's CodeDiff and PatchDiff components
- Use CodeDiff in Intervention for old/new content comparison
- Use PatchDiff in Render for unified diff patch display
- Remove react-diff-view dark theme CSS file
- Remove diff generation complexity, rely on built-in component styling
- Reduce code by ~93 lines

* 🔧 chore: add font-family style to previewText
2026-02-11 12:58:46 +08:00
Innei
b010ab9da8 ♻️ refactor(fileSearch): File/Content Search by Platform (#12074)
* ♻️ refactor(fileSearch): consolidate determineContentType to base class and use os.homedir()

- Move determineContentType method to FileSearchImpl base class with merged type mappings
- Replace process.env.HOME with os.homedir() in macOS and Linux implementations
- Replace process.env.USERPROFILE with os.homedir() in Windows implementation
- Remove duplicate implementation from three platform-specific classes

* refactor: content search service

* chore: add engine text

* fix: show engine

* test: add unit tests for contentSearch and fileSearch modules

- Add base.test.ts and index.test.ts for contentSearch module
- Add base.test.ts and index.test.ts for fileSearch module
- Test buildGrepArgs, determineContentType, escapeGlobPattern, etc.
- Test factory functions for platform-specific implementations

* 🐛 fix(contentSearch): use correct ripgrep glob patterns for nested path exclusion

Change `!node_modules` and `!.git` to `!**/node_modules/**` and `!**/.git/**`
to properly exclude nested directories as per ripgrep documentation.

* fix: types
2026-02-11 12:58:46 +08:00
Innei
6e65d725c5 🐛 fix(desktop): allow scrolling in read file view and improve new topic creation
- Add `overflow: auto` to ReadFileView component to fix content scrolling issue
- Update new topic creation to use current active agent instead of always navigating to inbox

Closes LOBE-4372
2026-02-11 12:58:42 +08:00
Arvin Xu
5e203b868c 💄 style: improve local-system tool implement (#12022)
* improve local system ability

* fix build

* improve tools title render

* fix tools

* update

* try to fix lint

* update

* refactor the LocalFileCtr.ts result

* refactor the exector result
2026-02-01 12:13:27 +08:00
Arvin Xu
3b41009a68 🐛 fix: fix add message and improve local system tool (#11815)
* fix add message

* fix grep content issue

* fix command tool

* improve loading
2026-01-25 22:54:38 +08:00
Arvin Xu
98cf57bc2c feat: support client tasks mode (#11666)
* fix exec client task

fix isSuccess

support client tasks

add tests

refactor to support client task mode

fix race mode

* improve

* improve notebook system prompts

* fix back actionicon

* improve

* fix create client thread data

* fix messages service and model

* add Client task mode

* fix client task thread

* fix isolation thead display

* fix client task mode

* refactor

* client task mode

* improve loading

* improve processing state

* improve loading state

* refactor usage display

* fix result

* improve

* more concurrency

* more concurrency
2026-01-21 02:33:26 +08:00
Arvin Xu
9ad468be06 🐛 fix: fix group subagent task issue (#11589)
* improve WriteFile feeling

* refactor exector

* improve task title

* fix flick

* improve i18n

* fix tests
2026-01-19 01:30:59 +08:00
Arvin Xu
51d2eae0dc 🐛 fix: fix group manage tools and supervisor config resolve (#11586)
* fix group management and agent builder

* try to fix group agent config id

* refactor local-system prompt
2026-01-18 23:01:01 +08:00
Arvin Xu
050499b8a9 💄 style: update readFile content (#11485)
update content
2026-01-14 11:59:36 +08:00
Arvin Xu
9012b40230 feat: improve group profile builder (#11452)
* improve group topic usage

update agent group builder

update to v267

update

update to use createAgentOnly

fix to remove activeId

💄 style: update inspector styles

refactor implement for agent builder and group builder

update style

* improve group profile mode

* fix editor canvas EditorData Mode

* move store to groupProfileStore

* update group profile design

* update test

* fix topic switch issue

* update all

* update tests
2026-01-13 16:07:30 +08:00
Innei
3a30d9aed1 refactor: migrate theme management to next-themes (#11112)
* refactor: migrate theme management to `next-themes` and remove theme from route variants and global store.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: Unify theme mode to 'system' instead of 'auto' and streamline Electron theme synchronization.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: Remove LOBE_THEME_APPEARANCE constant and simplify desktop theme source assignment.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: Update antd-style dependency from npm alias to specific alpha version.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update pnpm lockfile

Signed-off-by: Innei <tukon479@gmail.com>

* feat: Default theme to system and update Next.js RSC payload path example.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: add `dev:static` script for static renderer development

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: replace useThemeMode with custom useIsDark hook for theme detection and add ClientOnly component

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: Remove `extractStaticStyle` import and cache prop from `StyleRegistry`.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: Remove debug console log for current appearance.

Signed-off-by: Innei <tukon479@gmail.com>

* fix: Migrate legacy 'auto' theme mode to 'system' and refine theme background CSS selectors.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: Add window dragging to desktop onboarding layout and update antd-style dependency.

* refactor: Refine global background styling to target body elements, remove token-based background, and clean up debugging script.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-05 13:23:43 +08:00
Arvin Xu
d8deaddedd feat: add work path for local system (#11128)
*  feat: support to show working dir

* fix style

* update docs

* update topic

* refactor to use chat config

* inject working Directory

* update i18n

* fix tests
2026-01-03 16:22:22 +08:00
Arvin Xu
70a9cffc52 💄 style: improve tools UI and fix Google schema compatibility (#11096)
* ♻️ refactor: refactor tool implement

* 🐛 fix: fix google tool schema issue

* ♻️ refactor: refactor tool implement

*  feat: improve kb inspector

* 💄 style: improve local system inspector

* 💄 style: improve local system inspector

* 💄 style: improve web and kb inspector
2026-01-01 23:23:31 +08:00
Arvin Xu
44630bcfe4 💄 style: improve loading and local-system render (#11087)
* 💄 style: improve loading

* ♻️ refactor: move local-system to builtin-tool-local-system package

* update

* remove focusThrottleInterval
2026-01-01 13:24:17 +08:00
Arvin Xu
576ccd678c 💄 style: support tool streaming and title custom render (#10976)
* support custom inspector

* support local-system inspector

* add streaming feature

* merge
2025-12-25 23:52:57 +08:00
CanisMinor
c5fe456aec 🔨 chore: update compoents version (#10957)
chore: update deps
2025-12-25 12:52:31 +08:00
Innei
a69221f4f8 ♻️ refactor: refactor local-system 2025-12-24 12:54:36 +08:00