mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
346812ab889b94648bad3ea0cf1a9ef0a149d2bb
86 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
346812ab88 |
🔨 chore: update i18n files & fix title skeleton (#14301)
* chore: update i18n files & fix title skeleton * chore: update taskTemplate json * chore: update i18n files |
||
|
|
043d2a81fb |
✨ feat(agent): add floating chat panel and workspace improvements (#13887)
* ✨ feat(FloatingChatPanel): add single-instance mount guard * ✨ feat(FloatingChatPanel): add inner ChatBody layout * ✨ feat(FloatingChatPanel): add reusable floating conversation panel * ✅ test(FloatingChatPanel): add props wiring smoke tests * Refactor agent topic and page routes * Restore topic page routing for floating chat panel * ✨ feat(FloatingChatPanel): enhance ChatBody and TopicItem for improved routing and styling - Updated ChatBody to maintain scroll ownership while hiding overflow. - Refactored TopicItem to correctly highlight active topics based on routing context. - Added tests for TopicItem to ensure correct active state behavior. - Introduced static styles for FloatingChatPanel to manage layout overflow. Signed-off-by: Innei <tukon479@gmail.com> * chore: help to merge & rebase * chore: align merge with canary — drop pkg.pr.new ui, adopt canary useMenu, remove NotebookButton * ✨ feat: add ViewSwitcher component and update localization for chat views - Introduced a new ViewSwitcher component to toggle between chat, page, and task views in the conversation header. - Updated English and Chinese localization files to include new labels for the view switcher options. - Refactored the conversation header to integrate the ViewSwitcher, enhancing the user interface for better navigation. Signed-off-by: Innei <tukon479@gmail.com> * fix: update @lobehub/ui to version 5.9.1 and refactor FloatingChatPanel to use FloatingSheet component - Updated the @lobehub/ui dependency in package.json to version 5.9.1. - Refactored FloatingChatPanel to utilize the new FloatingSheet component, enhancing its layout and state management. - Introduced a new ChatLayout component for better organization of chat-related UI elements. - Adjusted routing configuration to incorporate the new ChatLayout for agent chat pages. Signed-off-by: Innei <tukon479@gmail.com> * feat: add TopicCanvas and TitleSection components for topic management - Introduced TopicCanvas component to serve as a document canvas for topics, integrating an editor and title section. - Added TitleSection component for managing topic titles and emojis, enhancing user interaction with a dedicated UI. - Updated FloatingChatPanel to accommodate the new TopicCanvas, ensuring a cohesive layout in the topic page. - Enhanced tests to verify the integration of TopicCanvas within the topic page route. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(agent-page): bind documentId to URL and introduce HeaderSlot - Add nested /agent/:aid/:topicId/page/:docId route with PageRedirect for bare /page - Introduce useAutoCreateTopicDocument with module-level inflight de-dup - Lift Portal + WorkingSidebar to (chat) layout; keep ChatHeader in left column - Sidebar document clicks on page route navigate to /page/:docId instead of opening Portal - Add HeaderSlot (context + createPortal) as a reusable header injection point - Mount AutoSaveHint via HeaderSlot; register Files hotkey scope in TopicCanvas so Cmd+S triggers manual save - Sync desktopRouter.config.tsx and desktopRouter.config.desktop.tsx - Extend RecentlyViewed plugin to round-trip optional docId segment * Use topic titles for auto-created page documents * Add page-agent init gating and runtime diagnostics * Support current-topic agent documents * Implement Active Topic Document and Disabled Tool Call Filtering - Introduced ActiveTopicDocumentContextInjector to inject context for active topic documents into user messages. - Added DisabledToolCallFilter to remove historical tool calls for disabled tools in the current runtime scope. - Updated MessagesEngine to utilize the new context injectors and filters. - Enhanced tests to verify the correct injection of active topic document context and filtering of disabled tool calls. This update improves the handling of document editing contexts and tool management in the conversation flow. Signed-off-by: Innei <tukon479@gmail.com> * feat: enhance agent document management with LiteXML operations - Updated API names for clarity, changing 'patchDocument' to 'modifyNodes'. - Introduced LiteXML operation schema for document modifications. - Implemented new mutation for modifying document nodes via LiteXML. - Enhanced document retrieval methods to support format options (XML, Markdown, Both). - Added support for editor data snapshots and normalization of diff nodes. - Improved document history management to handle editor data with diff nodes. - Created tests for new features and ensured existing functionality remains intact. Signed-off-by: Innei <tukon479@gmail.com> * 🐛 fix: apply agent document xml edits directly * Refine document cache invalidation and editor hydration * 🐛 fix: stabilize agent topic hydration * fix: update @lobehub/editor dependency version and clean up test mocks Signed-off-by: Innei <tukon479@gmail.com> * Potential fix for pull request finding 'Useless assignment to local variable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * 🐛 fix(document): preserve pending diff nodes through save path Skip normalizeEditorDataDiffNodes on every autosave so diff nodes awaiting user review survive persistence. Normalization now runs only on explicit Accept/Reject via DiffAllToolbar. Also flip headless litexml ops to delay:true to match the new review flow. * 🐛 fix(agent): detect agent sub-route from URL params not cached topic isInAgentSubRoute used routeTopicId (with activeTopicId fallback) as its base path. On /agent/:aid/profile with a cached activeTopicId, the base became /agent/:aid/:cachedTopicId which pathname cannot startsWith, so sub-route detection returned false and sidebar topic clicks only called switchTopic without routing back to chat — users stayed stuck on profile. Derive the sub-route base from params.topicId directly so stale store state cannot mask the check. routeTopicId export keeps the fallback for sidebar highlighting. * 🐛 fix(page): repair topic page document recovery * 🐛 fix(page-agent): block tool calls when page editor is not mounted scope is topic-bound not route-bound, so navigating from /agent/.../Page to /agent/... keeps scope==='page' and PageAgentIdentifier stayed in the injected plugin list. The LLM could still call initPage / modifyNodes / etc. against a stale editor reference, returning misleading success (e.g. nodeCount=0). Two layers of guard: - PageAgentExecutor wraps `invoke` and returns a structured PAGE_EDITOR_NOT_MOUNTED / kind: 'replan' result when the runtime editor is not mounted, pointing the LLM at lobe-agent-documents. - streamingExecutor drops PageAgentIdentifier from the tool set via the new `composeEnabledTools` pipeline when scope==='page' and the page-agent runtime is not ready. Also extract the tool-set composition (inject merge + runtime drops) out of the ~320-line internal_createAgentState into `mecha/toolSetComposer`, with unit tests. * 🐛 fix(chat): unify message stream for /agent/:topicId and /page/:docId Before this change a page-scoped conversation (FloatingChatPanel with scope='page' in the /Page route) partitioned the client message store by scope, so /agent/:topicId and /agent/:topicId/page/:docId each built their own messagesMap slot and SWR cache — but the TRPC getMessages endpoint ignores scope and returned the same messages for both, producing duplicate fetches and a visible message-history split between the two surfaces. Fixes by keeping scope='page' as a capability/surfacing marker only: - messageMapKey: collapse 'page' to the default scope early in toMessageMapContext, so threadId/groupId still win and only the main/page pair actually unifies. - useFetchMessages: build the SWR key from identity fields (agentId, groupId, threadId, topicId) instead of the full ConversationContext, so scope no longer partitions the cache. agentConfigResolver/streamingExecutor/composeEnabledTools still read scope='page' from operation.context for PageAgent injection and initialContext.pageEditor wiring — the capability layer is unchanged. Also fix two pre-existing test regressions surfaced by re-running the impacted suites: - streamingExecutor page-editor initialContext test now mocks pageAgentRuntime.isReady() (required since the PageAgent editor-ready guard landed). - FloatingChatPanel default shell props test updated to match the [180,320,520,800] snap points introduced in |
||
|
|
2a3667493f |
✨ feat(git-status): one-click pull/push from branch chip (#14041)
* ✨ feat(git-status): one-click pull/push from branch chip Split the ahead/behind indicator out of the BranchSwitcher trigger so ↓N / ↑N become standalone action chips: clicking ↓ runs `git pull --ff-only`, clicking ↑ runs `git push`. Each chip swaps to a spinning LoaderIcon while the operation is in flight and refreshes branch / working-tree / ahead-behind state on success. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(electron-ipc): extract Git IPC types into dedicated git.ts Move GitBranchInfo / GitLinkedPullRequest(Result) / GitBranchListItem / GitWorkingTree(Status|Files) / GitCheckoutResult / GitPullResult / GitPushResult / GitAheadBehind out of system.ts into a sibling git.ts so the system surface stays focused on system/window/theme types. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(git-status): push chip failing under push.default=simple Use `git push -u origin HEAD` instead of bare `git push` so the one-click push action works on branches whose upstream name differs from the local name (the common `git checkout -b feat/x origin/canary` workflow). Bare `git push` refuses in that case under the default simple policy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(git-status): push tooltip lying about target ref Push chip was reusing the pull upstream in its tooltip, which is wrong when local branch name differs from upstream (e.g. feat/x tracking origin/canary) — the push actually goes to origin/<local-name> per our `git push -u origin HEAD`, not to the upstream. Compute a separate `pushTarget` (`origin/<current-branch>`) and `pushTargetExists` flag in getGitAheadBehind, and switch the push tooltip to use that. When the target doesn't exist yet (one-click creates a new remote branch) show a "(new branch)" variant so the user knows what the click will do. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(git-status): ring spinner + clearer create-branch tooltip - Swap the lucide LoaderIcon (with hand-rolled CSS spin) for the shared RingLoadingIcon used in Topic items, so the in-flight pull/push chip matches the rest of the app's spinner style. - Reword the new-branch push tooltip from "push N commits to X (new branch)" to "Click to create branch X" — the count is misleading when the remote doesn't exist yet (the action is creating, not catching up), and the shorter copy reads cleaner. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Simplify comments in pushGitBranch method Removed detailed comments about git push behavior. * 🐛 fix(git-status): serialize pull/push on diverged branches Block the opposite sync action while a git sync is running — both chips go disabled whenever pulling or pushing is true. Previously on a diverged branch (ahead > 0 and behind > 0) a user could start pull and still click push before the first finished, launching concurrent git operations against the same worktree and producing lock / non-FF errors plus confusing double toasts for a single intent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(git-status): piggyback best-effort fetch on ahead/behind lookup Problem: ahead/behind was computed purely against locally-cached refs, so commits pushed to origin elsewhere (GitHub web UI, another machine) never surfaced as ↓N until the user ran `git fetch` in a terminal. Fix: run `git fetch --no-tags --quiet origin` at the start of getGitAheadBehind with a 10s timeout; ignore failures and fall through to compute against whatever refs we have. SWR's revalidateOnFocus already re-invokes this IPC, so the fetch happens on window re-focus for free — no new UI and no interval polling. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
b02b727261 |
✨ feat(heterogeneous-agent): support CC subagent rendering (#14001)
* ✨ feat(heterogeneous-agents): preserve CC subagent lineage in adapter Restores the CC subagent-lineage adapter work that was held back from #LOBE-7392 until the thread-router backend changes ship. This PR targets the LOBE-7392 branch so the adapter diff stays isolated from the thread/UI foundation — GitHub will auto-retarget to canary once LOBE-7392 merges. Original scope (unchanged from the held-back commits): - ToolCallPayload.parentToolCallId carries parent tool_use id downstream so consumers can group subagent inner tools under their spawning parent. - claudeCode.ts routes raw.parent_tool_use_id events through handleSubagentAssistant so the main-agent step tracker is not advanced on subagent message.id changes, usage is not double-counted, and subagent text / reasoning are dropped (their final answer flows back via the outer tool_result). - emitToolChunk helper shared by main-agent and subagent paths so new suppress-rules live in one place. - 6 subagent-lineage tests: lineage propagation, no newStep on subagent message.id change, no turn_metadata emission, text/reasoning drop, main-agent step boundary resumes after subagent, subagent tool_result passthrough. Refs LOBE-7319, LOBE-7260 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(workflow-collapse): move expand toggle to action slot Pass the fullscreen toggle as AccordionItem action so the built-in chevron indicator (same as TopicList) sits inline with the title on the left, with Maximize2/Minimize2 on the right. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(heterogeneous-agents): route CC Task tool_use to subagent Thread When a main-agent tool_use spawns a subagent, the executor now sync- allocates a threadId and creates a Thread, routing subsequent subagent inner tool_uses (tagged with `parentToolCallId` by the adapter) into that thread instead of the main assistant's tools[]. The "this tool_use spawns a subagent" decision lives entirely in the adapter layer via a new `ToolCallPayload.subagentSpawn` descriptor (`description`, `subagentType`). The CC adapter populates it on every `Task` tool_use; when Codex (or any other CLI) grows a subtask concept, its adapter populates the same field and the executor needs zero changes. The executor never checks `identifier === 'claude-code'` or `apiName === 'Task'` — it just reacts to the presence of `subagentSpawn`. - `ToolCallPayload.subagentSpawn?: { description?, subagentType? }` in `packages/heterogeneous-agents/src/types.ts` — adapter-agnostic spawn signal, paired with the existing `parentToolCallId` (which marks tool_uses BELONGING to a subagent). Together they cover both directions of the lineage. - `claudeCode.ts` stamps `subagentSpawn` on main-agent `Task` tool_uses using the already-parsed `block.input` — no redundant JSON.parse. - `ThreadService.createThread` helper wraps the sync-id TRPC mutation shipped in #14000. `generateThreadId()` mirrors the server's `idGenerator('threads', 16)` shape (`thd_<16 chars>`) so caller- provided ids match the schema pattern. - `persistNewToolCalls` splits fresh tools into main/subagent groups: Phase 1 (pre-register assistant.tools[]) and Phase 3 (backfill result_msg_id) run for main tools only. A new Phase 1b creates the Thread per `subagentSpawn` — guarded on `context.topicId` (required for Thread creation; missing falls back to normal tool rendering). Phase 2 writes tool messages for both groups, attaching `threadId` to subagent writes. Orphaned subagent events (parent spawn never registered) warn + drop instead of leaking into the main timeline. - `taskThreadMap` lives at executor scope (not on ToolPersistenceState which resets per step) so pathological orderings that straddle the main-agent step boundary can't lose the parent→thread mapping. 7 new tests: 2 adapter-level (subagentSpawn stamped on Task, NOT stamped on Read) + 5 executor-level (Thread creation, threadId propagation onto subagent tool messages, main assistant.tools[] isolation, orphan drop + warn, topicId-missing fallback). Refs LOBE-7319, LOBE-7392 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(types): persist subagent lineage fields on ChatToolPayload schema Add `parentToolCallId` and `subagentSpawn` as first-class optional fields on `ChatToolPayload` + `ChatToolPayloadSchema`, so the adapter- emitted lineage metadata survives the TRPC `update-message` gate instead of being silently stripped by zod's default strip behavior. Reviewer-flagged bug: `UpdateMessageParamsSchema.tools` runs each payload through `ChatToolPayloadSchema`, which previously only whitelisted `apiName / arguments / id / identifier / intervention / result_msg_id / thoughtSignature / type`. Any adapter-level extension (subagent spawn marker, parent-child pointer) was dropped before it ever reached the `messages.tools` JSONB column, so lineage only lived in transient stream events and vanished on the first `tool_end → fetchAndReplaceMessages`. Downstream consumers that wanted to key off `tool.subagentSpawn` to render a TaskBlock, or follow `tool.parentToolCallId` to reconstruct the spawning parent, had nothing to work with. - `SubagentSpawnInfo` + `SubagentSpawnInfoSchema` defined in `packages/types/src/message/common/tools.ts` as the canonical shape. Structurally identical to the same-named type in `@lobechat/heterogeneous-agents` (which stays self-contained by design) — TypeScript structural typing handles the bridge. - Both new fields are optional on the interface and the zod schema, so existing callers continue to parse unchanged. - Jsonb column accepts any shape, so no DB migration — the only missing piece was the schema gate. 3 new regression tests next to the executor's subagent-thread-routing suite, asserting `ChatToolPayloadSchema.parse()` preserves both fields and the same fields survive through `UpdateMessageParamsSchema` (the actual TRPC gate that was stripping them before). Refs LOBE-7319 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Revert "✨ feat(types): persist subagent lineage fields on ChatToolPayload schema" This reverts commit 042e48c7338aa8b502bcd6298a2871c758f348af. * ♻️ refactor(heterogeneous-agents): lift subagent context to event-peer fields `ToolCallPayload` is "one tool call" — it shouldn't carry stream-level lineage (parent spawn id, subagent turn id). That info describes the containing event/chunk and should live as a peer field on the event `data`, not nested inside each payload. Event model changes: - New `SubagentEventContext` + `SubagentSpawnMetadata` types. Events originating from a subagent stream (CC Task, future Codex subtask, etc.) carry `data.subagent` as a peer field next to `toolsCalling` / `toolCallId`. Covers `stream_chunk` (tools_calling), `tool_start`, `tool_end`, and `tool_result`. - `SubagentEventContext.spawnMetadata` appears ONLY on the first event for each new parent — lets the executor lazy-create the subagent Thread on first sight without needing to know CC-specific argument shapes or to re-parse `tool_use.input`. Subsequent events for the same parent carry just the lineage ids. - `ToolCallPayload` is back to its minimal form (`apiName / arguments / id / identifier / type`). No `parentToolCallId`, no `subagentSpawn` — those were the wrong abstraction level; removing them also sidesteps the `ChatToolPayloadSchema` strip-on-persist issue (the fields never need to survive DB roundtrip because Thread container persistence expresses the lineage). CC adapter (`claudeCode.ts`): - `handleSubagentAssistant` emits tools through a shared `emitToolChunk` that stamps the `subagent` peer field on the chunk + each tool_start. The FIRST subagent chunk for a new parent gets `spawnMetadata` pulled from a new adapter-internal `taskArgsById` cache — description / prompt / subagentType — announced exactly once via `announcedSpawns`. - `handleUser` stamps `subagent.parentToolCallId` on `tool_result` + `tool_end` when the user event carries `parent_tool_use_id` (CC's shape for subagent inner tool_results). - Main-agent tool_use handling no longer stamps lineage on payloads. Adapter tests updated — 4 rewrites in the subagent suite: - assert chunk-level peer fields (not payload-nested lineage) - assert `spawnMetadata` on first subagent event, absent on subsequent - assert main-agent tool_uses don't get `subagent` context - assert subagent `tool_result` + `tool_end` carry the peer 59 adapter tests pass (52 existing + 7 covering the new peer contract). Refs LOBE-7319, LOBE-7392 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(heterogeneous-agents): persist subagent runs as Thread containers Subagents now materialize as a nested conversation inside a Thread, shaped identically to the main topic: Thread ├─ user (content = Task prompt, threadId=thread.id) ├─ assistant#1 (tools[] = subagent turn 1 tool_uses, threadId) ├─ tool (parentId=assistant#1, threadId) ├─ assistant#2 (tools[] = subagent turn 2 tool_uses, threadId) └─ tool (parentId=assistant#2, threadId) Same schema as a main topic, just rooted at a Thread instead of a Topic. No new persistence shape, no new renderer — the existing `query({ threadId })` read path reconstructs the subagent's full conversation when the UI expands the TaskBlock. Executor changes: - `ToolPersistenceState` shrinks to `{ payloads, persistedIds }` — the `tool_use.id → tool message DB id` map moves to executor scope as one global `toolMsgIdByCallId` shared across main + every subagent run. `tool_result` lookups don't care which scope created the row. - `persistNewToolCalls` → renamed `persistToolBatch` and made scope- agnostic (takes an optional `threadId` + the global id map). Runs the same 3-phase flow (pre-register → create → backfill) whether target is main assistant or in-thread subagent assistant. - New `persistSubagentToolChunk` handles the subagent path: reads the adapter's `SubagentEventContext` peer field off the chunk, lazy- creates the Thread + user message on the FIRST chunk for each parent (using `spawnMetadata`), opens a new in-thread assistant on `subagentMessageId` change (same shape as main-agent step boundary), then delegates to `persistToolBatch`. - `SubagentRunState` tracks per-parent Thread id, current in-thread assistant, `currentSubagentMessageId`, chain parent, and its own `ToolPersistenceState`. Lives at executor scope so subagent events straddling a main-agent step boundary keep their mapping. - Step-boundary parent lookup reads from `toolState.payloads` (not the global id map) so main-agent chain doesn't accidentally pick up a subagent tool's msg id as the step parent. - Executor has NO CC-specific knowledge — it never checks `identifier`, `apiName`, or parses `tool_use.arguments`. All CC quirks live in the adapter; new CLIs (Codex subtask, ...) plug in by emitting the same `SubagentEventContext` peer. Test rewrite — 6 tests under "CC subagent thread-container": - Task tool_use alone does NOT create a Thread (lazy) - First subagent event creates Thread + `role:'user'` seeded with the Task prompt + first in-thread `role:'assistant'` - Subagent inner tools persist as `role:'tool'` messages with threadId set and parentId chained to the in-thread assistant - `subagentMessageId` change opens a new in-thread assistant - Main `assistant.tools[]` carries Task only; subagent inner tools appear on the in-thread assistant's `tools[]` - Missing topicId gracefully skips Thread creation 25 executor tests pass (19 existing + 6 rewritten for new shape). Refs LOBE-7319, LOBE-7392 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(heterogeneous-agents): subagent prompt + closing summary in Thread view Electron E2E surfaced two gaps in the Thread-container model shipped in the previous commit: 1. **Subagent user-message content empty.** Real CC emits `Agent` as the spawn-tool name for general-purpose subagents (not only `Task` as the spec documents). My earlier `taskArgsById` cache keyed off `ClaudeCodeApiName.Task` only, so `spawnMetadata.prompt` was undefined when the user watched the actual app — the Thread's `role:'user'` message landed with empty content and the thread view looked like a tool call floating alone. 2. **No closing summary in the Thread.** The adapter dropped subagent text/reasoning per an earlier comment claiming the subagent's final answer arrives via the outer tool_result. That's true for the MAIN timeline (the outer spawn tool's result content = the subagent's summary), but the THREAD view is a standalone conversation — dropping the subagent's final text left it ending on a bare tool call with no assistant conclusion. Adapter changes (`claudeCode.ts`): - Rename `taskArgsById` → `mainToolInputsById` and cache EVERY main-agent tool_use input (not just `Task`). `emitToolChunk` looks up the parent's input by `parent_tool_use_id` on the first subagent event and extracts `description` / `prompt` / `subagent_type` defensively — any CC spawn-tool variant that shares this input shape (`Task`, `Agent`, future ones) gets spawn metadata for free. - `handleSubagentAssistant` stops filtering `tool_use` only. Text and `thinking` blocks now emit as `stream_chunk` events with the `subagent` peer field attached — routed to the in-thread assistant, NOT the main assistant's accumulators. Executor changes (`heterogeneousAgentExecutor.ts`): - `SubagentRunState` gains `accumulatedContent` + `accumulatedReasoning`, mirroring main-agent content tracking. - Extract `ensureSubagentRun` helper so text chunks and tool chunks share the Thread / user / assistant lifecycle logic. On turn boundary (`subagentMessageId` change), flush the prior turn's accumulated content before creating the next in-thread assistant — covers text-only turns that never hit `persistToolBatch`. - New `persistSubagentTextChunk` accumulates text/reasoning onto the run; `persistToolBatch` writes content alongside tools[] so DB sees both in one update (same pattern as main agent). - New `finalizeSubagentRun` flushes pending content when the main- agent receives the spawn tool's `tool_result` — ensures the closing summary lands before `fetchAndReplaceMessages` refreshes from stale DB state. - `onComplete` iterates `subagentRuns.keys()` and flushes any un-finalized runs, covering the CLI-crashed-mid-subagent edge case. Tests: - Adapter: replaced the "drops subagent text" test with two tests asserting text/reasoning ARE emitted with correct `subagent` peer context. New test covers the `Agent` spawn-tool variant. - Executor: 4 new tests cover the Thread user message content population, subagent text accumulation into the in-thread assistant, non-leakage into main assistant content, and tool_result-triggered finalization. Total 29 executor tests pass. E2E verified via Electron + CDP: fresh CC session → `Agent`-based subagent → Thread created with `title="Run pwd command"`, `metadata.subagentType="general-purpose"`, `role:'user'` seeded with the Task prompt, Bash tool_use + result inside the thread. Refs LOBE-7319, LOBE-7392 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(heterogeneous-agents): refresh thread list when subagent Thread is lazy-created Earlier Electron E2E repro: a subagent Thread born mid-stream landed in DB correctly, but the topic sidebar only picked it up after the user manually navigated topics / called `refreshThreads()` — the SWR cache for the thread list (`SWR_USE_FETCH_THREADS`) wasn't invalidated, so the new Thread stayed invisible until the next cold fetch. - `ensureSubagentRun` now accepts an optional `onThreadCreated` callback fired once per lazy Thread create. Kept as a callback (not a direct `store.refreshThreads` call) so the executor persistence logic stays decoupled from the Zustand store shape. - `persistSubagentToolChunk` + `persistSubagentTextChunk` thread the callback through to `ensureSubagentRun`. - Executor defines `onSubagentThreadCreated` once at run scope and passes it into all three subagent persist call sites. Calls `get().refreshThreads()` fire-and-forget — it's a no-op when the user has navigated away from the topic, so no need to block persist on cache refresh. Two regression tests: - Subagent-spawning run → `refreshThreads` called exactly once - Non-subagent run (plain tool only) → `refreshThreads` NOT called Refs LOBE-7319, LOBE-7392 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(builtin-tool-claude-code): specialize Agent subagent Inspector + Render CC's subagent-spawn tool arrives as `tool_use.name: 'Agent'`, not `Task` — rename the apiName so the Inspector/Render registry actually matches the stream. Inspector switches icon/label by `subagent_type` (Explore / Plan / general-purpose / statusline-setup), with `description` surfaced in a chip; new Render shows `prompt` and tool_result as labelled Markdown blocks that can't fit in the folded header. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(workflow-collapse): unify expand toggle with ActionIcon Replace the hand-rolled motion span + role="button" / keyboard-handler expand toggle with a single @lobehub/ui ActionIcon — fewer a11y edge cases to maintain and the icon/title/blockSize layout matches other toolbar buttons in the group. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(builtin-tool-claude-code): inline-pad Edit diff container Give the Edit render a small inline padding so the CodeDiff lines up with the rest of the tool renders; zero-width flush-left was awkward against the surrounding labelled blocks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(heterogeneous-agents): interpolate agent name in running indicator ContentLoading now renders "{name} is running" / "{name} 运行中" for heterogeneous agent execution — previously it collapsed to the generic "External agent running" so a user watching a long CC run couldn't tell which external CLI was working (mattered once Codex landed as a sibling adapter). - Share `HETEROGENEOUS_TYPE_LABELS` (claude-code / codex) out of the heterogeneous-agents package so all consumers read one map; home Sidebar AgentItem switches to it and drops its inline copy. - `conversationLifecycle.startOperation` passes `metadata.heterogeneousType` on the heterogeneous-exec operation so ContentLoading can resolve the label from the running op without re-deriving the adapter type from session state. - New `operation.heterogeneousAgentFallback` key covers the (rare) case where the metadata is absent — keeps the dot loader labelled. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(claude-code): CC subagent Thread rendering pipeline Closes the viewing loop for CC subagent runs: the main-topic Agent tool row now links into the spawned Thread, the Thread's Portal view renders with provenance + read-only affordances, and the sidebar surfaces which entries are subagent-produced. UX: - Agent render gains a trailing "View / Collapse full subagent conversation" toggle. It looks up the Thread by `metadata.sourceToolCallId === toolCallId` and calls openThreadInPortal / closeThreadPortal — hidden until the executor lazy-creates the Thread on the first subagent event, so it never renders as a no-op. - Portal Thread Header shows a `[icon] subagentType` Tag next to the title ("Explore" / "General purpose" / ...). Inspector's folded row already exposes the same detail, so the icon + label stays consistent across the two surfaces. - Portal Thread Chat flips into read-only mode when `metadata.sourceToolCallId` is set: ChatInput is hidden (the external CLI owns the session — new turns have nowhere to go), `disableEditing` propagates to every message (no double-click to edit, no user action bar), and `useThreadActionsBarConfig` wipes `bar` + `menu` across assistant / assistantGroup / user roles. - Sidebar ThreadItem on both /agent and /group routes renders a plain "Subagent" badge next to the title when `metadata.subagentType` is present. The type detail deliberately lives on the Thread Header, not here — sidebar space is tight. Shared resolver: - `CC_SUBAGENT_TYPES` + `resolveCCSubagentType` move out of the Inspector into `packages/builtin-tool-claude-code/src/client/ subagentTypes.ts` and re-export from the `/client` entry. Inspector + Portal Thread Header both consume it, so the icon/label stay in sync. Kept UI-level (LucideIcon | FC) rather than pushed into heterogeneous-agents, which is a pure-data package. - Root package.json adds a direct dep on `@lobechat/builtin-tool-claude-code` so Portal Thread Header can import from `/client` (previously only transitive via builtin-tools). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✅ test(workflow-collapse): mock @lobehub/ui ActionIcon + AccordionItem action slot After the expand-toggle refactor to ActionIcon + the `action` prop on AccordionItem, the test's module mocks were missing both: ActionIcon wasn't exported from the @lobehub/ui mock, and AccordionItem dropped `action` on the floor so the toggle never made it into the rendered DOM. Restore both — ActionIcon renders as a real \`button\` with aria-label so \`getByRole('button', { name })\` can still target it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
c5db823a69 | 💄 style: add Kimi K2.6 to LobeHub-hosted card (#14006) | ||
|
|
a0471d5906 |
✨ feat(chat-input): branch ahead/behind badge + GitCtr refactor (#13980)
* 💄 style(todo-progress): replace green bar with inline progress ring Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(chat-input): split branch and diff blocks, add changed-files popover Branch now has its own hover tooltip for the full name; the diff stat is a sibling block that opens a lazy-loaded popover listing changed files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(chat-input): show ahead/behind commit count vs upstream Adds a badge next to the branch chip showing commits pending push (↑, blue) and pull (↓, red) against the branch's upstream tracking ref. Hidden when no upstream is configured or both counts are zero. Refreshed on focus, after checkout, and on manual refresh from the branch switcher. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(desktop): extract git IPC methods into dedicated GitController Moves detectRepoType, getGitBranch, getLinkedPullRequest, listGitBranches, getGitWorkingTree{Status,Files}, getGitAheadBehind, and checkoutGitBranch out of SystemCtr into a new GitCtr (groupName = 'git'). Shared helpers (resolveGitDir / resolveCommonGitDir / detectRepoType) become pure functions under utils/git.ts so SystemCtr's selectFolder can still probe the picked folder without crossing controller boundaries. Renderer side: new electronGitService wraps ipc.git.*, and all six chat-input hooks plus BranchSwitcher are switched over. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(chat-input): inline ahead/behind arrows into branch chip Moves the ↑/↓ counts out of a separate status block and inside the branch trigger next to the label, so they sit with the branch they describe instead of after the file-change badge. Tooltip folds into the branch tooltip (full name · N to push · M to pull) so a single hover covers both pieces of info. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(desktop): parse git status with -z to avoid filename misparse The previous getGitWorkingTreeFiles split every line on ' -> ' to detect renames, but only R/C status codes emit that delimiter. Legitimate filenames containing ' -> ' (or spaces, or embedded newlines) were misparsed — the popover would report a truncated path or lose the entry entirely. Switch both getGitWorkingTreeStatus and getGitWorkingTreeFiles to `git status --porcelain -z`: NUL-terminated records, no C-style quoting, no \n splitting hazards. Rename/copy entries emit two NUL-separated tokens (DEST\0SRC) which we consume as a pair so counts and paths stay correct. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(todo-progress): hide stale todos when a new user turn starts Add `selectCurrentTurnTodosFromMessages` that scopes the todos lookup to messages after the last user message. The inline TodoProgress component now uses it, so a completed 8/8 progress bar from a previous operation no longer lingers across the next user turn. The original `selectTodosFromMessages` is unchanged because the agent runtime step context still needs cross-turn visibility of the plan. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🔒 fix(desktop): tighten GitHub remote detection to host position Replace substring check `config.includes('github.com')` with a regex anchored to URL host position so look-alikes like `evilgithub.com` and `github.com.attacker.com` no longer classify as GitHub. Closes CodeQL "Incomplete URL substring sanitization" on PR #13980. Not a real security issue (the config file is local and the classification only drives a UI icon), but the tightened check is strictly more correct and silences the scanner. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
46df77ac3f |
💄 style(tab-bar): blend inactive tabs with titlebar, show close icon by default (#13973)
* 💄 style(tab-bar): blend inactive tabs with titlebar, show close icon by default Inactive tabs now use a transparent background and gain a subtle hover fill, matching Chrome's tab chrome so the titlebar feels visually unified. The close icon is always visible instead of fading in on hover, so users don't have to hunt for it on narrow tabs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(desktop): CMD+N now actually clears active topic on agent page Previously the File → 新建话题 (CMD+N) handler only `navigate()`d to the agent base path. When the user was on `/agent/:aid?topic=xxx`, this stripped the URL param but `ChatHydration`'s URL→store updater skips `undefined` values, so `activeTopicId` in the chat store was never cleared and the subscriber would push the stale topic right back into the URL. Call `switchTopic(null)` on the store directly when an agent is active so the change propagates store→URL via the existing subscriber. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(hetero-agent): don't surface self-cancelled exits as runtime errors User-initiated cancel/stop and Electron before-quit kill the agent process with SIGINT/SIGTERM, producing non-zero exit codes (130/143/137). Mark these via session.cancelledByUs so the exit handler routes them through the complete broadcast — otherwise a user cancel or app shutdown would look like an agent failure (e.g. "Agent exited with code 143" leaking into other live CC sessions' topics). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(tab-bar): show running indicator dot on tab when agent is generating Adds a useTabRunning hook that reads agent runtime state from the chat store for agent / agent-topic tabs, and renders a small gold dot over the tab avatar/icon while the conversation is generating. Other tab types stay unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(claude-code): render ToolSearch select: queries as inline tags Parses select:A,B,C into individual tag chips (monospace, subtle pill background) instead of a comma-joined string, so the names of tools being loaded read more clearly. Keyword queries keep the existing single-highlight rendering. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(git-status): show +N ±M -K diff badge next to branch name Surface uncommitted-file count directly in the runtime-config status bar so the dirty state is visible at a glance without opening the branch dropdown. Each segment is color-coded (added / modified / deleted) and hidden when zero; a tooltip shows the verbose breakdown. Implementation: - Backend buckets `git status --porcelain` lines into added / modified / deleted / total via X+Y status pair - New always-on useWorkingTreeStatus SWR hook (focus revalidation, 5s throttle) shared by GitStatus and BranchSwitcher — single fetch path - BranchSwitcher's "uncommitted changes: N files" now reads `total` Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(assistant-group): show only delete button while tool call is in progress When the last child of an assistantGroup is a running tool call, `contentId` is undefined and the action bar fell through to a branch that dropped the `menu` and `ReactionPicker`, leaving a single copy icon with no overflow. Replace the legacy `continueGeneration / delAndRegenerate / del` bar with a del-only bar in this state — delete is the only action that makes sense before any text block is finalized. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(conversation-flow): aggregate per-step nested metadata.usage in assistantGroup After hetero-agent moved to per-step usage writes (`metadata: { usage: {...} }`), the assistantGroup virtual message stopped showing the cumulative token total across steps and instead surfaced only the last step's numbers. Root cause: splitMetadata only recognised the legacy flat shape (`metadata.totalTokens`, etc.) and didn't read the new nested shape, so each child block went into aggregateMetadata with `usage: undefined`. The sum was empty, and the final group inherited a single child's metadata.usage purely because Object.assign collapsed groupMetadata down to the last child. - splitMetadata now reads both nested (`metadata.usage` / `metadata.performance`) and flat (legacy) shapes; nested takes priority - Add `'usage'` / `'performance'` to the usage/performance field sets in parse and FlatListBuilder so the nested objects don't leak into "other metadata" - Regression test: multi-step assistantGroup chain sums child usages Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(hetero-agent): tone down full-access badge to match left bar items The badge was shouting in colorWarning + 500 weight; reduce to colorTextSecondary at normal weight so it sits at the same visual rank as the working-dir / git buttons on the left. The CircleAlert icon still carries the warning semantics. Also force cursor:default so the non-interactive label doesn't pick up an I-beam over its text. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
7d5889a7ed |
✨ feat(heterogeneous-agent): git-aware runtime config + topic rename modal + inspectors (#13951)
* ✨ feat(cc-desktop): git-aware runtime config + topic rename modal + inspectors Cluster of desktop UX improvements around the Claude Code integration: - CC chat input runtime bar: branch switcher, git status, and a richer working-directory bar powered by a new SystemCtr git API (branch list / current status) and `useGitInfo` hook. - Topic rename: switch to a dedicated RenameModal component; add an auto-rename action in the conversation header menu. - ToolSearch inspector for the CC tool client. - Shared DotsLoading indicator. - Operation slice tidy-ups for CC flows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(types): rename heterogeneous provider type `claudecode` → `claude-code` Align the type literal with the npm/CLI naming convention used elsewhere (@lobechat/builtin-tool-claude-code, claude-code provider id) so the union matches the rest of the codebase. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(cc-desktop): polish TodoWrite labels, branch switcher refresh, and chat input affordances - TodoWrite render + inspector: i18n the header label (Todos / Current step / All tasks completed), surface the active step inline as highlighted text, and switch the in-progress accent from primary to info for better contrast. - BranchSwitcher: move the refresh button into the dropdown's section header, switch the search and create-branch inputs to the filled variant, and reuse DropdownMenuItem for the create-branch entry instead of a custom footer chip. - GitStatus: drop the inline refresh affordance (now lives in the switcher), collapse trigger styles, and split the PR badge with its own separator. - WorkingDirectory / WorkingDirectoryBar: tighten paddings and gaps so the runtime config row reads at a consistent height. - InputEditor: skip inline placeholder completion when the cursor is not at end of paragraph — inserting a placeholder mid-text triggered nested editor updates that froze the input. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(cc-desktop): probe repoType for working dirs not cached in recents GitStatus was gated on the `repoType` stored in `recentDirs`, but legacy string entries and agent-config-driven paths that never went through the folder picker have no cached `repoType`. As a result, branch / PR status silently disappeared for valid git repos until users re-selected the folder. Promote `detectRepoType` to a public IPC method and add a `useRepoType` hook that uses the cached value as a fast path, otherwise probes the filesystem via SWR and backfills the recents entry so subsequent reads hit cache. Both runtime config bars (CC mode + heterogeneous chat input) now resolve `repoType` through the hook. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(shared-tool-ui): rework Bash/Grep/Glob inspector rows - RunCommand: terminal-prompt icon + mono command text instead of underline highlight - Grep: split pattern by `|` into mono tag chips - Glob: single mono tag chip matching Grep - Switch rows to baseline alignment so the smaller mono text lines up with the label Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(DotsLoading): allow optional color in styles params The Required<StyleArgs> generic forced color to string, but it's only defaulted at the CSS level via fallback to token.colorTextSecondary. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
03d2068a5d |
✨ feat(onboarding): add feature flags and footer promotion pipeline (#13853)
* ✨ feat(onboarding): enhance agent onboarding experience and add feature flags - Added new promotional messages for agent onboarding in both Chinese and default locales. - Updated HighlightNotification component to support action handling and target attributes. - Introduced feature flags for agent onboarding in the configuration schema and tests. - Implemented logic to conditionally display onboarding options based on feature flags and user state. - Added tests for the onboarding flow and promotional notifications in the footer. This update aims to improve the user experience during the onboarding process and ensure proper feature management through flags. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(home): add footer promotion pipeline with feature-flag gating Extract resolveFooterPromotionState for agent onboarding vs Product Hunt promos. Normalize isMobile boolean, refine HighlightNotification CTA layout, extend tests. Made-with: Cursor * ✨ feat(locales): add agent onboarding promotional messages in multiple languages Added new promotional messages for agent onboarding across various locales, enhancing the user experience with localized action labels, descriptions, and titles. This update supports a more engaging onboarding process for users globally. Signed-off-by: Innei <tukon479@gmail.com> * 💄 chore: refresh quick wizard onboarding promo * 🐛 fix(chat): keep long mixed assistant content outside workflow fold * ✨ feat(onboarding): add agent onboarding feedback panel and service LOBE-7210 Made-with: Cursor * ✨ feat(markdown-patch): add shared markdown patch tool with SEARCH/REPLACE hunks Introduce @lobechat/markdown-patch util and expose patchDocument API on the web-onboarding and agent-documents builtin tools so agents can apply byte-exact SEARCH/REPLACE hunks instead of resending full document content. * ✨ feat(onboarding): prefer patchDocument for non-empty documents Teach the onboarding agent (systemRole) and context engine (OnboardingActionHintInjector) to prefer patchDocument over updateDocument when SOUL.md or User Persona already has content, keeping updateDocument reserved for the initial seed write or full rewrites. * 🐛 fix(conversation): add rightActions to ChatInput component Updated the AgentOnboardingConversation component to include rightActions in the ChatInput, enhancing the functionality of the onboarding conversation interface. Signed-off-by: Innei <tukon479@gmail.com> * Add specialized onboarding approval UI * 🐛 fix(serverConfig): handle fetch errors in server config actions Updated the server configuration action to include error handling for fetch failures, ensuring that the server config is marked as initialized when an error occurs. Additionally, modified the SWR mock to simulate error scenarios in tests. Signed-off-by: Innei <tukon479@gmail.com> * 🐛 fix(tests): update Group component tests with new data-testid attributes Added data-testid attributes for workflow and answer segments in the Group component tests to improve test targeting. Adjusted the isFirstBlock property for consistency and ensured the component renders correctly with the provided props. Signed-off-by: Innei <tukon479@gmail.com> --------- Signed-off-by: Innei <tukon479@gmail.com> |
||
|
|
15fcce97c9 |
♻️ refactor: add more tools in lobe-agent-manangerment(modify、update、delete) (#13842)
* feat: add more tools in lobe-agent-manangerment * feat: add the ensureAgentLoaded to modify it * feat: add the update prompt tools |
||
|
|
08769e5bf1 |
🐛 fix: layout recent locale and support dismiss banner (#13739)
* fix: CN locale for rencents * fix: community profile setup modal * feat: support skill banner dismiss |
||
|
|
4f1d2d494f |
✨ feat(conversation): assistant group workflow collapse and activate-tools inspector (#13696)
* refactor(workflow): rewrite WorkflowSummary with status dot and minimal flat style * refactor(workflow): rewrite WorkflowCollapse with unified borderless container * ✨ feat(workflow): add WorkflowExpandedList component and fix type errors * ♻️ refactor(workflow): add missing Workflow components with Minimal Flat design - WorkflowReasoningLine: cssVar tokens, aligned padding - WorkflowToolDetail: new expandable result panel with motion animation - WorkflowToolLine: expand chevron, getToolColor, detail panel integration - WorkflowExpandedList: flat rendering with reasoning + tool lines * Add tool call collapse support Made-with: Cursor * 💄 style(workflow): align WorkflowCollapse UI with @lobehub/ui design system - Align border-radius, gap, padding tokens across all Workflow components - Replace chevron expand/collapse with status icons (CheckCircle2, CircleX, Loader2) - Use @lobehub/ui Highlighter for tool detail panel with JSON auto-formatting - Use @lobehub/ui Flexbox for WorkflowExpandedList with proper gap and padding - Fix delete action to use removeToolFromMessage instead of deleteAssistantMessage - Wire debug button to existing Tool/Debug panel with full tabs - Fix auto-collapse to only trigger on incomplete→complete transition - Single ChevronDown with rotation for WorkflowSummary (match @lobehub/ui pattern) * 💄 style(workflow): use AccordionItem and inspectorTextStyles for WorkflowCollapse - Replace custom WorkflowSummary with @lobehub/ui AccordionItem - Use StatusIndicator pattern (Block outlined 24x24) for status icon - Apply inspectorTextStyles.root for title text (colorTextSecondary) - Remove WorkflowSummary.tsx (dead code) - Match Tool component AccordionItem usage (paddingBlock/Inline=4, borderless) * 💄 style(workflow): remove divider and gap from WorkflowExpandedList * 💄 style(workflow): align WorkflowCollapse title bar with Thinking component * 💄 style(workflow): unify inner item spacing, font size, and colors * ✨ feat(workflow): add streaming scroll behavior with max-height and auto-scroll * 💄 refactor(assistant-group): refine workflow collapse UI and duration - Use Accordion for collapse; align tool/reasoning lines with generation state - Show workflow header duration from summed block performance, not reasoning only Made-with: Cursor * ✨ feat(inspector): enhance ActivateToolsInspector to display not found tools count - Added localization for not found tools message in English, Chinese, and default locales. - Updated ActivateToolsInspector to show a tooltip with the count of tools not found. - Modified StatusIndicator to support a warning state for scenarios where no tools are activated but some are not found. Signed-off-by: Innei <tukon479@gmail.com> * 💄 style(workflow): simplify padding in WorkflowExpandedList component - Removed unnecessary paddingInline from Flexbox elements in WorkflowExpandedList for cleaner layout. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(assistant-group): introduce constants and utility functions for workflow management - Added constants for workflow timing, limits, and tool display names to enhance the assistant group's functionality. - Implemented utility functions for processing and scoring post-tool answers, improving the workflow's response handling. - Created new components for rendering content blocks and managing scroll behavior in the assistant group. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(assistant-group): enhance ContentBlock and Group components with content handling logic - Added logic to conditionally render message content based on content availability and tool presence in ContentBlock. - Introduced utility functions to determine substantive content and reasoning in Group, improving block partitioning for workflow management. - Updated partitioning logic to handle trailing reasoning candidates and streamline answer and working block separation. Signed-off-by: Innei <tukon479@gmail.com> * 🙈 chore(gitignore): clarify superpowers local paths Document that `.superpowers/` and `docs/superpowers/` are plugin/local outputs and must not be committed. Made-with: Cursor * 👷 chore(ci): restore auto-tag-release workflow from canary Revert unintended workflow edits so release tagging stays on main with sync-main-to-canary dispatch. Made-with: Cursor --------- Signed-off-by: Innei <tukon479@gmail.com> |
||
|
|
147ff3976f | ✨ feat: add Seedance 2.0 & 2.0 Fast video generation models (#13663) | ||
|
|
4d15979fab |
💄 fix(RuntimeConfig): instant-apply working directory with recent list (#13641)
* 💄 fix(RuntimeConfig): instant-apply working directory with recent list Remove Save/Cancel buttons from working directory selector. Directories now apply immediately on click. Show recent directories list with checkmark for active selection and "Choose a different folder" entry at bottom. * ✨ feat(SystemCtr): enhance folder selection to return repository type Updated the `selectFolder` method to return an object containing the selected folder path and its repository type (either 'git' or 'github'). Added a new private method `detectRepoType` to determine the repository type based on the presence of a `.git/config` file. Introduced a new utility for managing recent directories, allowing the application to display appropriate icons based on the repository type in the UI. Signed-off-by: Innei <tukon479@gmail.com> --------- Signed-off-by: Innei <tukon479@gmail.com> |
||
|
|
965fc929e1 |
feat: add unified messaging tool for cross-platform communication (#13296)
* ✨ feat: add cross-platform message tool for AI bot channel operations Implement a unified message tool (`lobe-message`) that provides AI with messaging capabilities across Discord, Telegram, Slack, Google Chat, and IRC through a single interface with platform-specific extensions. Core APIs: sendMessage, readMessages, editMessage, deleteMessage, searchMessages, reactToMessage, getReactions, pin/unpin management, channel/member info, thread operations, and polls. Architecture follows the established builtin-tool pattern: - Package: @lobechat/builtin-tool-message (manifest, types, executor, ExecutionRuntime, client components) - Registry: registered in builtin-tools (renders, inspectors, interventions, streamings) - Server runtime: stub service ready for platform adapter integration https://claude.ai/code/session_011sHc6R7V4cSYKere9RY1QM * feat: implement platform specific message service * chore: add wechat platform * chore: update wechat api service * chore: update protocol implementation * chore: optimize platform api test * fix: lark domain error * feat: support bot message cli * chore: refactor adapter to service * chore: optimize bot status fetch * fix: bot status * fix: channel nav ignore * feat: message tool support bot manage * feat: add lobe-message runtime * feat: support direct message * feat: add history limit * chore: update const limit * feat: optimize server id message history limit * chore: optimize system role & inject platform environment info * chore: update readMessages vibe * fix: form body width 50% * chore: optimize tool prompt * chore: update i18n files * chore: optimize read message system role and update bot message lh * updage readMessage api rate limit * chore: comatible for readMessages * fix: feishu readMessage implementation error * fix: test case * chore: update i18n files * fix: lint error * chore: add timeout for conversaction case * fix: message test case * fix: vite gzip error --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
b4862f2942 |
🐛 fix: manual tool disabled (#13218)
fix: manual tool disabled |
||
|
|
efd99850df | ✨ feat(agentDocuments): added agent documents impl, and tools (#13093) | ||
|
|
4438b559e6 |
✨ feat: add slash action tags, topic reference tool, and command bus system (#12860)
* ✨ feat: add slash action tags in chat input Made-with: Cursor * ✨ feat: enhance editor with new slash actions and localization updates - Added new slash actions: change tone, condense, expand, polish, rewrite, summarize, and translate. - Updated localization files for English and Chinese to include new action tags and slash commands. - Removed deprecated useSlashItems component and integrated its functionality directly into InputEditor. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: add slash placement configuration to chat input components - Introduced `slashPlacement` prop to `ChatInputProvider`, `StoreUpdater`, and `InputEditor` for customizable slash menu positioning. - Updated initial state to include `slashPlacement` with default value 'top'. - Adjusted `ChatInput` and `InputArea` components to utilize the new `slashPlacement` prop. This enhancement allows for better control over the user interface in chat input interactions. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: implement command bus for slash action tags processing Add command bus system to parse and execute slash commands (compact context, new topic). Refactor action tag categories from ai/prompt to command/skill. Add useEnabledSkills hook for dynamic skill registration. * feat: compress command Signed-off-by: Innei <tukon479@gmail.com> * refactor: compress Signed-off-by: Innei <tukon479@gmail.com> * fix: skill inject * ✨ feat: slash action tags with context engine integration Made-with: Cursor * ✨ feat: add topic reference builtin tool and server runtime Made-with: Cursor * ✨ feat: add topic mention items and update ReferTopic integration Made-with: Cursor * 🐛 fix: preserve editorData through assistant-group edit flow and update RichTextMessage reactively - EditState now forwards editorData from EditorModal to modifyMessageContent - modifyMessageContent accepts and passes editorData to updateMessageContent - RichTextMessage uses useEditor + effect to update document on content change instead of key-based remount - Refactored RichTextMessage plugins to use shared createChatInputRichPlugins() * ✨ feat(context-engine): add metadata types and update processors/providers Made-with: Cursor * ✨ feat(chat-input): add slash action tags and restore failed input state * 🔧 chore: update package dependencies and enhance Vite configuration - Changed @lobehub/ui dependency to a specific package URL. - Added multiple SPA entry points and layout files to the Vite warmup configuration. - Removed unused monorepo packages from sharedOptimizeDeps and added various dayjs locales for better localization support. Signed-off-by: Innei <tukon479@gmail.com> * 🔧 chore: update @lobehub/ui dependency to version 5.4.0 in package.json Signed-off-by: Innei <tukon479@gmail.com> * 🐛 fix: correct SkillsApiName.runSkill to activateSkill and update trimmed content assertions * 🐛 fix: resolve type errors in context-engine tests and InputEditor slashPlacement * 🐛 fix: update runSkill to activateSkill in conversationLifecycle test * 🐛 fix: avoid regex backtracking in placeholder parser * ✨ feat(localization): add action tags and tooltips for slash commands across multiple languages Signed-off-by: Innei <tukon479@gmail.com> * 🐛 fix: preserve file attachments when /newTopic has no text content * cleanup Signed-off-by: Innei <tukon479@gmail.com> --------- Signed-off-by: Innei <tukon479@gmail.com> |
||
|
|
a5cc75c1ed |
🐛 fix: lh command issue (#12949)
* fix command issue * add run command UI * fix API key * add apikey page * add apikey * 🐛 fix: update apiKey model tests to use new sk-lh- prefix format Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
2399f672e2 |
✨ feat: add lobehub skill (#12922)
* add builtin lobehub skills * refactor cloud sandbox * refactor cloud sandbox * improve styles |
||
|
|
93aed84399 |
🔨 chore(i18n): sync locale files across desktop and web (#12887)
Made-with: Cursor |
||
|
|
026af3f6bc |
🐛 fix: mcp tool install loading (#12629)
fix: mcp tool install loading |
||
|
|
ac0be5ed5c | ✨ feat: add video tab to provider ModelList settings page (#12534) | ||
|
|
0ec6c2f38e | ✨ feat(cloud): add Nano Banana 2 support (#12493) | ||
|
|
c5d41fd2be |
✨ feat: use lobe-tools to support progressive disclosure (#12489)
* activatedTool type * support active tools * fix explicitActivation tools issue * improve search ux * improve search result * improve search result * improve system prompts * fix types * fix tests * refactor a skills store tools * refactor a skills store tools * improve issue * fix some tests * fix tests * enable skills by default |
||
|
|
e95f7419b9 | ✨ feat: support agent skills (#12424) | ||
|
|
501352e035 |
✨ feat: add tool agents in tool detail page (#11993)
* chore: upgrade market sdk to 0.29.2 * feat: add skill recommendations to agent detail * fix: agent link error * feat: support agents using this skill * feat: support agents using tool list virtual and load more * chore: remove lobehub skill detail loading * feat: mcp detail support load more * fix: mcp detail in comunity scroll problem * chore: update i18n files |
||
|
|
07d223117c |
🐛 fix: skill detail error (#11949)
* chore: use only fetch once swr * chore: use mcp detail tool list * chore: update tools detail * chore: update i18n files * fix: skill style * chore: add skill loading |
||
|
|
641de4c3ef | feat: add intergration Detail Content and skill list | ||
|
|
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 |
||
|
|
5d115ef3cb |
🐛 fix: fix favorite refresh bug and group topic refresh issue (#11745)
* fix memory i18n * fix history limit issue and favorite topic * fix tests * fix tests * fix tests * 🧪 test(chat): fix getChatCompletion second parameter assertion Update test assertions to use expect.anything() instead of undefined for the second parameter of getChatCompletion, as it now receives { agentId, topicId } context object. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix group topic * fix lobeai link --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
d8c0c264b9 |
✨ feat: skill setting page and skill store (#11665)
* ✨ feat: add skills settings page Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add klavis skills and sort with connected skills * chore: update i18n files # Conflicts: # locales/ar/models.json # locales/bg-BG/models.json # locales/de-DE/models.json # locales/es-ES/models.json # locales/fa-IR/models.json # locales/fr-FR/models.json # locales/it-IT/models.json # locales/ja-JP/models.json # locales/ko-KR/models.json # locales/nl-NL/models.json # locales/pl-PL/models.json # locales/pt-BR/models.json # locales/ru-RU/models.json # locales/tr-TR/models.json # locales/vi-VN/models.json # locales/zh-CN/models.json # locales/zh-TW/models.json * feat: add skill list and configure # Conflicts: # src/features/PluginStore/InstalledList/List/Item/Action.tsx * chore: optimize list item ui * chore: change list title * chore: update i18n files # Conflicts: # locales/ar/chat.json # locales/ar/models.json # locales/ar/plugin.json # locales/ar/setting.json # locales/ar/subscription.json # locales/bg-BG/chat.json # locales/bg-BG/models.json # locales/bg-BG/plugin.json # locales/bg-BG/tool.json # locales/de-DE/chat.json # locales/de-DE/plugin.json # locales/es-ES/chat.json # locales/es-ES/models.json # locales/es-ES/plugin.json # locales/fa-IR/chat.json # locales/fa-IR/models.json # locales/fa-IR/plugin.json # locales/fr-FR/chat.json # locales/fr-FR/models.json # locales/fr-FR/plugin.json # locales/it-IT/chat.json # locales/it-IT/models.json # locales/it-IT/plugin.json # locales/ja-JP/chat.json # locales/ja-JP/models.json # locales/ja-JP/plugin.json # locales/ko-KR/chat.json # locales/ko-KR/models.json # locales/ko-KR/plugin.json # locales/nl-NL/chat.json # locales/nl-NL/models.json # locales/nl-NL/plugin.json # locales/pl-PL/chat.json # locales/pl-PL/models.json # locales/pl-PL/plugin.json # locales/pt-BR/chat.json # locales/pt-BR/models.json # locales/pt-BR/plugin.json # locales/ru-RU/chat.json # locales/ru-RU/models.json # locales/ru-RU/plugin.json # locales/tr-TR/chat.json # locales/tr-TR/models.json # locales/tr-TR/plugin.json # locales/vi-VN/chat.json # locales/vi-VN/models.json # locales/vi-VN/plugin.json # locales/vi-VN/setting.json # locales/zh-CN/models.json # locales/zh-TW/chat.json # locales/zh-TW/models.json # locales/zh-TW/plugin.json * chore: sort skill list * feat: add Lobehub intergration promotions * chore: set gray color to not connected integrations * feat: remove description and adjust intergration ui * feat: intergration action bar optimize * feat: configure skill setting page * chore: remove detail page * chore: add custom mcp tool detail * feat: unified custome and community mcp tool detail model # Conflicts: # locales/ar/models.json # locales/ar/plugin.json # locales/bg-BG/models.json # locales/bg-BG/plugin.json # locales/de-DE/plugin.json # locales/es-ES/models.json # locales/es-ES/plugin.json # locales/fa-IR/models.json # locales/fa-IR/plugin.json # locales/fr-FR/models.json # locales/fr-FR/plugin.json # locales/it-IT/models.json # locales/it-IT/plugin.json # locales/ja-JP/models.json # locales/ja-JP/plugin.json # locales/ko-KR/models.json # locales/ko-KR/plugin.json # locales/nl-NL/models.json # locales/nl-NL/plugin.json # locales/pl-PL/models.json # locales/pl-PL/plugin.json # locales/pt-BR/models.json # locales/pt-BR/plugin.json # locales/ru-RU/models.json # locales/ru-RU/plugin.json # locales/tr-TR/models.json # locales/tr-TR/plugin.json # locales/vi-VN/models.json # locales/vi-VN/plugin.json # locales/zh-CN/models.json # locales/zh-TW/models.json # locales/zh-TW/plugin.json * feat: adjust configure model ui actions * feat: add custom skill add button * chore: update add button text * feat: add confirm modal for disconnect action * feat: add Skill Store * fix: skill integration connnect loading status * chore: align Skill Store UI with PluginStore * feat: add Search list function * chore: optimize search placeholder * feat: add integration skill detail modal * feat: add community detail modal to skill store * feat: add i18n locales for klavis and lobehub skill detail # Conflicts: # locales/ar/models.json # locales/bg-BG/models.json # locales/bg-BG/plugin.json # locales/de-DE/plugin.json # locales/es-ES/models.json # locales/es-ES/plugin.json # locales/fa-IR/models.json # locales/fr-FR/models.json # locales/it-IT/models.json # locales/it-IT/plugin.json # locales/ja-JP/models.json # locales/ko-KR/models.json # locales/ko-KR/plugin.json # locales/nl-NL/models.json # locales/nl-NL/plugin.json # locales/pl-PL/models.json # locales/pl-PL/plugin.json # locales/pt-BR/models.json # locales/pt-BR/plugin.json # locales/ru-RU/models.json # locales/tr-TR/models.json # locales/tr-TR/plugin.json # locales/vi-VN/models.json # locales/vi-VN/plugin.json # locales/zh-CN/models.json # locales/zh-TW/models.json # locales/zh-TW/plugin.json * chore: update skill detail model i18n files # Conflicts: # locales/ar/models.json # locales/bg-BG/models.json # locales/es-ES/models.json # locales/fa-IR/models.json # locales/fr-FR/models.json # locales/it-IT/models.json # locales/ja-JP/models.json # locales/ko-KR/models.json # locales/nl-NL/models.json # locales/pl-PL/models.json # locales/pt-BR/models.json # locales/ru-RU/models.json # locales/tr-TR/models.json # locales/vi-VN/models.json # locales/zh-CN/models.json # locales/zh-TW/models.json * feat: add recommended skills and add Skill install banner * chore: optimize skill install banner style * feat: add skill management and Add skill icon * chore: add skill list order * feat: display selected skills and fix simple icon display * feat: add custom skill to skill store * chore: remove online mcp url and add claude skill tab # Conflicts: # src/features/PluginDevModal/index.tsx * chore: remove installed tab * fix: lobe hub list connect in detail and extract use skill connect hook * chore: migrate from Dropdown to DropMenu * chore: remove difference between community list and lobehublist * chore: remove difference from kalvis and lobehub skill item with mcp skill item * chore: mv from installlist to mcp list * chore: rename addPluginButton to AddSkillButton * chore: use SkillStore across the app * chore: migrate PluginStore to SKillStore * chore: add test case * chore: update i18n files --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
32be2b2882 |
🐛 fix: fix group sub task execution (#11595)
* update memory manifest * support console error in the server with subagent task * ✅ test(agent-service): add unit tests for getAgentConfig method Add 7 test cases for the new getAgentConfig(idOrSlug) method: - Return null if agent does not exist - Support lookup by agent id - Support lookup by slug - Merge DEFAULT_AGENT_CONFIG and serverDefaultAgentConfig - Use default model/provider when agent has none - Prioritize agent model/provider over defaults - Merge user default agent config Relates to: LOBE-3514 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * ✨ feat(group-agent-builder): add GetAgentInfo Inspector Add Inspector component for getAgentInfo API to display agent avatar and name in the tool call UI. Changes: - Add GetAgentInfoInspector component with avatar and title display - Register inspector in GroupAgentBuilderInspectors registry - Add i18n translations for en-US and zh-CN 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix lobehub manifest temporarily * fix twitter calling * 🔧 chore: remove unused serializeError function 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * 🐛 fix(test): fix execAgent.threadId test mock for AgentService Add AgentService mock and use importOriginal for model-bank mock to fix test failures after refactoring to use AgentService. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
9ad468be06 |
🐛 fix: fix group subagent task issue (#11589)
* improve WriteFile feeling * refactor exector * improve task title * fix flick * improve i18n * fix tests |
||
|
|
676611e5bd |
🤖 style: update i18n (#11482)
💄 style: update i18n Co-authored-by: canisminor1990 <17870709+canisminor1990@users.noreply.github.com> |
||
|
|
277b42d3d9 |
💄 style: improve auto scroll and loading hint (#11579)
* improve operation hint * improve i18n * try to fix auto scroll |
||
|
|
488175a143 |
✨ feat: improve memory tool display and refactor tool render (#11525)
* fix memory display * refactor assisant group tool * rename render to detail * refactor * feat support display message tool ui * fix memory issue |
||
|
|
7d066eb7d1 |
✨ feat: improve group prompt context engine and fix group supervisor response issue (#11490)
* improve group prompt context engine * fix tests * fix send group messages * add group management * fix metadata * fix delete multi messages * update sandbox ui * update |
||
|
|
484ffb3ef7 | ✨ feat: update model definitions and sync i18n (#11468) | ||
|
|
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
|
||
|
|
88721ebd5d |
♻️ refactor: refactor page and notebook document usage (#11345)
* update create document
* refactor
* clean document/notebook slice
* update
* fix agent access issue
* ♻️ refactor: 重构 editorCanvas 实现以支持 Notebook editor 的复用
* fix editor autosave time
* refactor page editor
* update
* fix page editor init issue
* fix page editor data flow
* finish Page refactor
* update editor canvas
* improve notebook document
* update editor runtime test
* update mode
* fix editor hot reload issue
* update mode
* fix
* update
* update
* update
|
||
|
|
f7dc54fb37 |
✨ feat(notebook): add i18n, Inspector and Streaming components (#11212)
* ✨ feat(notebook): add i18n, Inspector and Streaming components - Add i18n entries for notebook tool in plugin.ts - Add zh-CN and en-US translations - Add CreateDocument Inspector component for streaming status display - Add CreateDocument Streaming component for real-time markdown preview - Add AnimatedNumber helper component - Export NotebookInspectors and NotebookStreamings from client 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * 🐛 fix(notebook): simplify Inspector to show title directly Follow WebSearch Inspector pattern - use direct string concatenation instead of Trans component 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * 🐛 fix(notebook): add isLoading state for shiny animation Match WebSearch Inspector pattern - show shiny animation during both streaming and loading states 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor * improve document --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
8078cb9778 |
♻️ refactor: refactor and fix model runtime initialize (#11134)
* ♻️ refactor: refactor and fix model runtime initialize
* fix test for model runtime
* improve loading style
* fix tests
* fix error mode
* fix error display issue
* improve style
* try to fix issue
* improve style
* improve task Inspector style
* update i18n
* fix task error state
* update i18n
* fix error result
* fix error
|
||
|
|
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
|
||
|
|
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 |
||
|
|
2a631b476f |
✨ feat: rename codeinterpreter into lobe sandbox (#11076)
* feat: rename codeinterpreter into lobe sandbox * fix: fixed the market publish agent too much |
||
|
|
f708cdb901 | 💄 style: support streaming and display ui for group mode | ||
|
|
dba1acf2b4 | ✨ feat: support exec async sub agent task | ||
|
|
8b67718158 | docs: update subscription locale json | ||
|
|
0664563da7 | 💄 style: improve gtd tool inspector and todo list |