Commit Graph

19 Commits

Author SHA1 Message Date
carry d04c85d959 feat: 增强多模态支持,更新 export 和 MediaView 组件以处理图片 URL,优化消息内容构建逻辑 2026-06-08 21:13:55 +08:00
carry 742659df43 feat: 将 demo 数据迁移为 JSON 协议文件,激活 Raw Protocol 面板
- 新建 6 个 demo JSON 文件 (demo-a ~ demo-f),替代 TS 硬编码常量
- 新建 prompt-envelope.schema.json (JSON Schema Draft 2020-12)
- 新建 demos-loader.ts: validateEnvelope() 运行时验证 + hydrateSkills() 从 skills 源补全 body
- 新建 manifest.json 场景索引
- ProtocolPanel: Raw Protocol tab 已激活,可切换查看原始 PromptEnvelope JSON
- demo.ts 改为从 JSON import + loadEnvelope() 加载
- Skill body 不入协议,仅保留 name + description (L1),由加载器补全
- 时间戳改为固定 epoch 毫秒值
- 删除 6 个旧 demo-{a..f}.ts 文件

构建通过,26 个测试全部通过
2026-06-08 20:52:44 +08:00
carry 0869e5bf34 fix: 修正静态变量处理逻辑,确保其不出现在 system 消息中,仅用于模板展开 2026-06-08 15:54:42 +08:00
carry d31b42e4c2 feat: 更新 CLAUDE.md,修正测试命令和消息结构,增强 Skills 系统描述 2026-06-08 14:53:57 +08:00
carry 8c39eb8124 feat: 更新 demo-f.ts,增强 SKILL.md body 加载和上下文注入功能 2026-06-07 23:25:56 +08:00
carry 290cc55abf feat: 场景 C 重写为文档解析场景,DocumentCard 增加「查看解析」交互
- DocumentSegment 新增 parsedContent 字段,存储 AI 对文档的解析结果
- DocumentCard 增加「查看解析 / 收起解析」按钮,展开后以 Markdown 渲染解析内容
- 场景 C 从「长文本+文档+多模态」改为「单文档解析」场景,聚焦展示解析功能
- ChatContext 默认 activeDemo 索引修正为 4
2026-06-07 23:12:34 +08:00
carry b8e4961d10 fix: 修正 SkillItem 类型为标准的 Anthropic SKILL.md 格式
将 SkillItem 从虚构的 detail/triggers/instructions/format 字段简化
为标准 SKILL.md 定义:name + description + body。

- protocol.ts: SkillItem 精简为 {name, description, body}
- SkillsView.tsx: 从 3 层改为 2 层渐进式披露
- skills.ts / skills-loader.ts: 去掉多余的映射字段
- .gitignore: 排除外部 skills/ 仓库克隆目录
2026-06-07 22:57:46 +08:00
carry e47587f492 feat: Skills 渐进式披露机制 — Anthropic SKILL.md 解析器 + 文件加载 2026-06-07 22:51:44 +08:00
carry 513ab249fb refactor: 将 demos.ts 拆分为 demos/ 目录下的 5 个独立场景文件 2026-06-07 22:41:24 +08:00
carry 6e98170a7d feat: 更新场景 B 的工具调用流程,支持代码执行和语言选择 2026-06-07 22:11:02 +08:00
carry bab102538d feat: 添加服务器配置,允许从所有主机访问 2026-06-07 21:57:11 +08:00
carry a4b06c7284 feat: tool_call_request/result 拆分为独立 role:tool 消息气泡
- protocol.ts: Message.role 增加 'tool'
- MessageBubble: 新增 tool 角色配置(琥珀色,小写 label 统一)
- MessageList: 新增 extractToolMessages(),将 tool segment
  从 assistant/user 消息中拆分出来作为独立 tool 角色消息
- role label 改为小写(system/user/assistant/tool),字号 text-xs
- demos.ts: e-4 改为 tool_call_result 形式
2026-06-07 15:18:57 +08:00
carry 92ecb139ad refactor: 静态变量提到对话外 + System Prompt 模板展开可视化
- 新建 SessionBar:会话变量独立于消息气泡,显示在对话顶部
- 重写 SystemPromptView:解析 {{var}} 占位符并内联展示模板→变量映射
- 重构 MessageList:提取 static_var 到 varMap,过滤后传入气泡
- 更新 SegmentRenderer + MessageBubble:传递 varMap 到 SystemPromptView
- 更新所有 Demo:static_var 从 user 消息迁移到 system 消息,使用真实会话配置(current_date、language、knowledge_cutoff)
- 更新导出逻辑:system 消息中收集 static_var 并在模板中展开 {{var}}
- 更新测试:新增模板展开用例,18 tests pass
2026-06-07 14:44:29 +08:00
carry 483b1a7f39 feat: Skills 渐进式披露 — Anthropic 3层展开机制 + Agent 主动触发 skill
- protocol.ts: SkillItem 新增 detail/triggers/instructions 渐进式披露字段
- SkillsView.tsx: 重写为 3 层展开组件(名称→详情→完整指令),skill 触发时指令作为独立 system 消息追加到对话
- demos.ts: Demo C/D skills 升级为 5 个真实 Anthropic skills(deep-research/code-review/verify/simplify/loop);新增 Demo E 展示 Agent 主动触发 /deep-research 的完整流程
- ChatContext.tsx: 默认激活 Demo E
2026-06-07 14:23:55 +08:00
carry f22c9f8aeb feat: 添加 CLAUDE.md 文件,提供项目指导和架构概述 2026-06-07 13:56:46 +08:00
carry fec598af62 feat: add Markdown rendering to text segments
- Add react-markdown + remark-gfm for GFM-compatible markdown rendering
- Create MarkdownRenderer component with custom Tailwind-styled elements
- Update TextSegmentView to render markdown instead of plain text
- Update LongTextView to render markdown when expanded
- Fix Lucide icon type in DocumentCard
2026-06-07 13:53:57 +08:00
carry 241156853c feat: add description field to Memory & Skills segments for better context transparency 2026-06-07 13:49:58 +08:00
carry 34b3f44856 refactor: wrap tool call request args as labeled key-value rows instead of raw JSON 2026-06-07 13:46:55 +08:00
carry a9881eac26 feat: Prompt Envelope Protocol MVP
- 定义 11 种 Segment 类型(text, static_var, system_prompt, memory, skills, tool_overview, tool_call_request/result, document, long_text, media)
- 每种 Segment 有独立的颜色编码和折叠交互
- 通用 CollapsiblePanel + SegmentRenderer 路由架构
- 4 个 Demo 场景覆盖全部 9 种上下文类型
- 导出为 OpenAI Chat Completions Format(model + messages + tools)
- tool_overview -> 请求级 tools[](含 JSON Schema)
- tool_call_request -> assistant.tool_calls[]
- tool_call_result -> tool-role message(ID 配对)
- 17 个单元测试全部通过
- React 18 + TypeScript + Vite + Tailwind CSS
2026-06-07 13:44:36 +08:00