做 Datasette 插件或智能体应用的开发者,这个插件解决了文本编辑工具重复造轮子的问题,可以直接复用核心逻辑来构建自己的编辑功能。
Simon Willison 发布了 datasette-agent-edit 0.1a0,这是一个为 Datasette Agent 设计的插件,用于实现智能体对文本的编辑操作。该插件参考了 Claude 文本编辑器的设计,提供了 view、str_replace 和 insert 三个核心工具,支持查看带行号的文件、精确替换文本和在指定行后插入内容。作者计划基于此插件开发协作 Markdown 编辑、SQL 查询更新和 SVG 文件编辑等功能。通过将编辑模式抽象为通用插件,避免了为每个场景重复实现相同逻辑。
datasette-agent-edit 0.1a0
Release: datasette-agent-edit 0.1a0 I'm planning several plugins for Datasette Agent which can make edits to existing pieces of text - things like collaborative Markdown editing, updating large SQL queries, and editing SVG files. Agentic editing of text is a little tricky to get right. My favorite published design for this is for the Claude text editor , which implements the following tools: view - view sections of a file, with line numbers added to every line. str_replace - find an exact old_str and replace it with new_str - fail if the original string is not unique insert - insert the specified text after the specified line number Rather than recreate these patterns for every plugin that needs them I decided to create this base plugin, datasette-agent-edit , which implements the core tools in a way that allows them to be adapted for other plugins. Tags: ai , datasette , generative-ai , llms , llm-tool-use , datasette-agent