- TopNav: '文档' link only shows when loggedIn
- AgentToolbar: document button v-if="loggedIn"
- getAgentToolsForChatByAgentId: filter tools by agentPublicToolSlugs
whitelist for guest users (previously only skipped adminOnly tools,
exposing document and other non-public tools to unauthenticated users)
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
LLM was still calling document read/list despite memory being in context.
Use explicit prohibition: '禁止调用 document 工具的 read 或 list 操作来读取这些记忆'
and clarify that memory is always current, only use tool for create/modify.
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
Memory context is already injected into system prompt, so add explicit
instruction telling the LLM to use it directly instead of calling the
document tool to re-read memories.
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
- AgentDocumentDrawer: delete button in list cards and detail view header
with confirm dialog, auto-refresh list after delete
- Drawer now re-fetches on every open (not just first time)
- agent-document service: add getMemoryContext(userId) — queries all
memory-type docs, wraps in <memory> tag
- chat-engine: inject memory context into systemPrompt for logged-in users
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
- Service layer: map rows with deserializeTags to return string[] not JSON string
- Frontend: add null guard on item.tags.length to prevent render crash when tags is null
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
drizzle timestamp_ms mode returns Date objects, but AI SDK Zod schema
validation rejects Date in tool-result output.value (expects string).
Add toISO() helper to convert all createdAt/updatedAt fields to ISO
string format before returning from document executor.
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
When a tool-call is in 'approval-responded' state with approved=true but
hasResult=false (approval executed but result not yet available in
approvalToolResults), the code was pushing a tool-call part to the
assistant message without a corresponding tool-result in the tool message.
This caused providers (e.g. deepseek) to reject the prompt with
'Tool result is missing for tool call' or
'Invalid prompt: The messages do not match the ModelMessage[] schema'.
Fix: only push tool-approval-request (not tool-call) when hasResult=false.
Also clean up approval-requested branch to only include required fields
(type, approvalId, toolCallId) per AI SDK schema.
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
- GET /api/agent-documents: list documents with type/keyword/pagination filters
- GET /api/agent-documents/🆔 get document detail with content
- PATCH /api/agent-documents/🆔 update document title/content/tags
- DELETE /api/agent-documents/🆔 delete document
- All endpoints require authentication and enforce user-level isolation
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
- Implemented color tool with operations for conversion, random color generation, color info, mixing, and contrast detection.
- Added dice tool supporting rolling dice, coin flipping, item picking, and rock-paper-scissors.
- Introduced hashing tool for computing and comparing hash values using various algorithms.
- Created magic 8-ball tool for answering yes/no questions and providing daily fortunes.
- Defined configuration schemas and input validation for each tool using Zod.
- Registered new tools in the agent tool registry with appropriate default configurations and input schemas.
- Remove ChatWidget component from app.vue
- Update index.vue to ensure flex layout accommodates new design
- Add systemPrompt field to agentSessions table in the database
- Modify createSession and updateSession services to support systemPrompt
- Enhance API endpoints to accept and update systemPrompt
- Adjust chat engine to prioritize session-level systemPrompt over agent default
- Extend AgentSessionItem interface to include systemPrompt
- Revamp AgentSystemPromptModal to allow editing of systemPrompt
- Integrate editable system prompt functionality in AgentToolbar and chat page
- Add E2E tests for session-level system prompt functionality
- Update design document to reflect new system prompt capabilities
- Added supportsTools field to LLM models in various API endpoints.
- Updated model creation and update functions to handle supportsTools.
- Modified chat and agent APIs to utilize supportsTools for tool management.
- Enhanced error handling and validation for new field in relevant endpoints.
- Updated migration journal to include new model version for supportsTools.
- Added hasPendingApproval prop to AgentChatArea for managing tool approval state.
- Updated AgentInput to show a placeholder when disabled due to pending approvals.
- Modified AgentMessageItem to handle feedback and actions based on approval status.
- Enhanced AgentMessageList to manage scrolling behavior during loading states.
- Introduced cleanup-approvals API to handle stale tool approvals.
- Updated useAgentChat composable to manage tool approval logic and state.
- Enhanced chat API to support tool approval responses and continue conversation after approval.
- Refactored agent tool fetching logic to remove unnecessary approval configurations.
- Improved session message handling to support new message parts structure.
- Updated agent configuration page to include a title generation model for guest users.
- Added a new preferences page for users to set their preferred LLM model.
- Implemented loading and saving functionality for user preferences.
- Introduced new API endpoints for guest users to access models and system prompts.
- Enhanced model loading logic to accommodate guest users and their default models.
- Improved error handling and user feedback for model saving operations.
- Added search tool executor with support for Bing, Baidu, and Google.
- Implemented parsing logic for search results from different engines.
- Updated session management to utilize user-specific model preferences.
- Added adminOnly field to CreateAgentToolInput and UpdateAgentToolInput interfaces.
- Updated API endpoints to handle adminOnly field in agent tools.
- Modified getEnabledToolInfos and getEnabledToolsForLlm functions to filter tools based on user role.
- Enhanced the chat tools API to retrieve enabled tools considering user roles.
- Updated migration journal to include new patch for adminOnly feature.
- Implemented datetime executor with operations for current time retrieval, formatting, parsing, time difference calculation, time addition, and timezone conversion.
- Added json formatter executor supporting formatting, minifying, validating, and extracting fields from JSON strings.
- Introduced regex tester executor for matching, testing, replacing, and extracting matches from input text using regular expressions.
- Created uuid executor for generating UUIDs, random strings, and random integers with configurable options.
- Updated agent tool registration to include new executors and their configurations.
- Enhanced input validation and error handling across all new executors.
- Removed "json-schema-to-zod" from dependencies in package.json.
- Deleted the register.ts file from the agent-tool service as it is no longer needed.
- Updated the db.sqlite binary file in drizzle-pkg.
- Added @ai-sdk/openai dependency to package.json and bun.lock
- Implemented chat index endpoint to handle user messages and stream responses from OpenAI
- Created models endpoint to retrieve active LLM providers and their models for the authenticated user
- Updated drizzle-pkg database with a new SQLite file
- Implemented GET, POST, PUT, and DELETE endpoints for managing LLM models and providers.
- Added user authorization checks to ensure only authorized users can access or modify resources.
- Enhanced provider and model retrieval functions to include user-specific data.
- Updated database service functions to handle user IDs for better data isolation.
- Introduced error handling for invalid inputs and unauthorized actions.
- Implemented GET, POST, PUT, DELETE endpoints for LLM providers and models.
- Added validation for provider and model IDs.
- Introduced functions to list, create, update, and delete providers and models in the service layer.
- Enhanced error handling for invalid inputs and non-existent resources.
- Updated database schema to include new provider and model management features.
- Added new API endpoints for project management: create, read, update, and delete projects.
- Implemented pagination for listing projects.
- Introduced siteIcon configuration in global settings.
- Updated file upload to support additional image formats (ICO, SVG).
- Enhanced validation for project input data.
- Implemented GET endpoint for listing ideas with pagination.
- Implemented POST endpoint for creating new ideas with validation.
- Added service functions for listing and creating ideas, including random color assignment.
- Created database schema for ideas in the migration files.
- Updated migration journal to reflect new versioning and changes.
- Add ChatWidget component for real-time chat functionality, including unread message notifications and @mention toasts.
- Create useChat composable for managing chat messages and SSE connections.
- Update index page layout to welcome users.
- Define API routes for fetching chat messages, sending messages, and managing unread counts.
- Implement chat message storage in SQLite with necessary migrations.
- Add server-side logic for handling chat message broadcasting and user connection tracking.
- Ensure chat messages are persisted across server restarts and implement rate limiting for message sending.
- Introduced new API endpoints for managing SMTP email configuration (GET, PUT, POST).
- Implemented email sending functionality using Nodemailer.
- Added middleware to require admin permissions for accessing admin routes.
- Updated admin sidebar navigation to conditionally display items based on admin role.
- Created a new email configuration page in the admin panel with form validation and test functionality.
- Masked sensitive information in API responses.
- Enhanced scheduler execution and task management APIs to require admin permissions.
- Added a new JSON file for desktop topic titles.
- Added a new `content` field to the `cards` table in the database.
- Updated the card creation and update schemas to include the `content` field.
- Modified the card service to handle the new `content` field in create and update operations.
- Enhanced search functionality to include the `content` field.
- Updated migrations to reflect the addition of the `content` field in the database schema.
- Added the `marked` package for potential markdown processing in the content field.
- Implemented CRUD operations for articles including create, read, update, and delete functionalities.
- Added validation for article input data using Zod.
- Introduced caching mechanisms to clear related card caches upon article updates and deletions.
- Enhanced card schema to include article associations.
- Updated favorite and card listing services to include associated articles.
- Added new migration for articles.