代理聊天运行时,markdown 是协议
概览
一个代理聊天运行时的原型,以 markdown 为协议。LLM 流式 markdown 文本,执行 TypeScript 代码,在服务器端阻挡,并在客户端渲染反应式 UI 组件——全部在单一响应中完成。 Markdown 是代理型人工智能助手的理想协议。它是大型语言模型(LLM)已经理解的,将散文、可执行代码和结构化数据混合,格式无需新训练。 📖 智能人工智能助手的未来是......Markdown 在浏览器中打开http://localhost:4000。 邮件、日历和联系人技能需要Google OAuth凭证。没有这些,在你的.env中设置FENCED_DISABLE_GOOGLE_SKILLS=true,跳过加载这些技能。 1. 进入 Google Cloud 控制台 2.创建项目(或选择已有项目) 3.启用 , , 和 4.配置(外部,将你的邮箱添加为测试用户) 5.在 下,添加以下范围: - https://www.googleapis.com/auth/gmail.modify - https://www.googleapis.com/auth/calendar - https://www.googleapis.
概述(AI 翻译)
一个代理聊天运行时的原型,以 markdown 为协议。LLM 流式 markdown 文本,执行 TypeScript 代码,在服务器端阻挡,并在客户端渲染反应式 UI 组件——全部在单一响应中完成。
论点: Markdown 是代理型人工智能助手的理想协议。它是大型语言模型已经理解的,将散文、可执行代码和结构化数据混合,格式无需新训练。
📖 **阅读附带文章:**智能人工智能助手的未来是…Markdown
Docker 快速入门
在浏览器中打开http://localhost:4000。
环境变量
| 变量 | 必需 | 描述 |
|---|---|---|
OPENAI_API_KEY |
是的 | OpenAI 用于生成大型语言模型的 API 密钥 |
FENCED_DISABLE_GOOGLE_SKILLS |
没有 | 设置为 1 以禁用 Google 技能(邮件、联系人、日历)。建议在无 Google OAuth 凭证的情况下运行。 |
地方发展
先决条件
- 面包>= 1.0
布置
谷歌技能(邮件、日历、联系人)
邮件、日历和联系人技能需要Google OAuth凭证。没有这些,可以在你的’中设置FENCED_DISABLE_GOOGLE_SKILLS=true。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
fenced
A prototype of an agentic chat runtime where markdown is the protocol. The LLM streams markdown text, executes TypeScript code blocks server-side, and renders reactive UI components on the client—all within a single response.
Thesis: Markdown is the ideal protocol for agentic AI assistants. It’s what LLMs already understand, mixing prose, executable code, and structured data in a format that requires no new training.
📖 Read the accompanying article: The Future of Agentic AI Assistants Is… Markdown
Quick Start with Docker
# Build the image
docker build -t fenced .
# Run with required environment variables
docker run -p 4000:4000 \
-e OPENAI_API_KEY=your-openai-api-key \
-e FENCED_DISABLE_GOOGLE_SKILLS=true \
fenced
Open http://localhost:4000 in your browser.
Environment Variables
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY |
Yes | OpenAI API key for LLM generation |
FENCED_DISABLE_GOOGLE_SKILLS |
No | Set to 1 to disable Google skills (mail, contacts, calendar). Recommended when running without Google OAuth credentials. |
Local Development
Prerequisites
- Bun >= 1.0
Setup
# Install dependencies
bun install
# Create .env file
cp .env.example .env
# Edit .env with your OPENAI_API_KEY
# Run dev servers (two terminals)
bun run dev:server # Bun API on port 4000
bun run dev:client # Vite dev server with HMR
# Or use tmux to run both
bun run dev
Google Skills (Mail, Calendar, Contacts)
The mail, calendar, and contacts skills need Google OAuth credentials. Without them, set FENCED_DISABLE_GOOGLE_SKILLS=true in your .env to skip loading these skills.
1. Create OAuth credentials:
- Go to Google Cloud Console
- Create a project (or select an existing one)
- Enable the Gmail API, Google Calendar API, and People API
- Configure the OAuth consent screen (External, add your email as test user)
- Under Credentials → Data Access, add these scopes:
https://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/calendarhttps://www.googleapis.com/auth/contacts
- Go to Credentials → Create Credentials → OAuth client ID
- Choose Desktop app as the application type
- Download the JSON and save it as:
packages/skills/src/google-auth/client_secret.json
2. Generate access token:
bun run google:renew-token
This starts a local server on port 3000, opens your browser for OAuth consent, and saves the token to token.json.
3. Verify it works:
bun run google:test-auth
4. Done. The agent can now use gmail, calendar, and contacts globals in agent.run blocks.
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add fabiankuebler/fenced