mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 05:14:54 +00:00
Close [AI-396](https://linear.app/affine-design/issue/AI-396) <img width="798" height="294" alt="截屏2025-07-25 11 30 32" src="https://github.com/user-attachments/assets/6366dab2-688b-470b-8b24-29a2d50a38c9" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **New Features** * Introduced a "Section Edit" AI tool for expert editing of specific markdown sections based on user instructions, preserving formatting and style. * Added a new interface and UI component for section editing, allowing users to view, copy, insert, or save edited content directly from chat interactions. * **Improvements** * Enhanced AI chat and tool rendering to support and display section editing results. * Updated chat input handling for improved draft management and message sending order. * **Other Changes** * Registered the new section editing tool in the system for seamless integration. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
38 lines
1.6 KiB
TypeScript
38 lines
1.6 KiB
TypeScript
import { ToolSet } from 'ai';
|
|
|
|
import { createCodeArtifactTool } from './code-artifact';
|
|
import { createConversationSummaryTool } from './conversation-summary';
|
|
import { createDocComposeTool } from './doc-compose';
|
|
import { createDocEditTool } from './doc-edit';
|
|
import { createDocKeywordSearchTool } from './doc-keyword-search';
|
|
import { createDocReadTool } from './doc-read';
|
|
import { createDocSemanticSearchTool } from './doc-semantic-search';
|
|
import { createExaCrawlTool } from './exa-crawl';
|
|
import { createExaSearchTool } from './exa-search';
|
|
import { createSectionEditTool } from './section-edit';
|
|
|
|
export interface CustomAITools extends ToolSet {
|
|
code_artifact: ReturnType<typeof createCodeArtifactTool>;
|
|
conversation_summary: ReturnType<typeof createConversationSummaryTool>;
|
|
doc_edit: ReturnType<typeof createDocEditTool>;
|
|
doc_semantic_search: ReturnType<typeof createDocSemanticSearchTool>;
|
|
doc_keyword_search: ReturnType<typeof createDocKeywordSearchTool>;
|
|
doc_read: ReturnType<typeof createDocReadTool>;
|
|
doc_compose: ReturnType<typeof createDocComposeTool>;
|
|
section_edit: ReturnType<typeof createSectionEditTool>;
|
|
web_search_exa: ReturnType<typeof createExaSearchTool>;
|
|
web_crawl_exa: ReturnType<typeof createExaCrawlTool>;
|
|
}
|
|
|
|
export * from './code-artifact';
|
|
export * from './conversation-summary';
|
|
export * from './doc-compose';
|
|
export * from './doc-edit';
|
|
export * from './doc-keyword-search';
|
|
export * from './doc-read';
|
|
export * from './doc-semantic-search';
|
|
export * from './error';
|
|
export * from './exa-crawl';
|
|
export * from './exa-search';
|
|
export * from './section-edit';
|