## 核心价值主张
flowchart LR
A[用户痛点] --> B[我们的解决方案]
B --> C[用户收益]
A1[在笔记和AI工具间
频繁切换] --> B1[AI直接嵌入
Obsidian侧边栏]
A2[AI无法访问
本地笔记内容] --> B2[笔记库成为AI
工作目录]
A3[重复性编辑任务
耗时费力] --> B3[AI自动读写
批量处理文件]
A4[需要编写代码
分析笔记数据] --> B4[AI执行bash命令
搜索和分析]
B1 --> C1[工作流无缝衔接
无需切换窗口]
B2 --> C2[AI理解全部上下文
回答更精准]
B3 --> C3[10倍提升
笔记整理效率]
B4 --> C4[零基础也能
自动化处理笔记]
style A fill:#334155,stroke:#334155,color:#fff
style C fill:#15803d,stroke:#15803d,color:#fff
style B fill:#1e293b,stroke:#334155,color:#fff
style A1 fill:#334155,stroke:#334155,color:#fff
style A2 fill:#334155,stroke:#334155,color:#fff
style A3 fill:#334155,stroke:#334155,color:#fff
style A4 fill:#334155,stroke:#334155,color:#fff
style B1 fill:#1e293b,stroke:#334155,color:#fff
style B2 fill:#1e293b,stroke:#334155,color:#fff
style B3 fill:#1e293b,stroke:#334155,color:#fff
style B4 fill:#1e293b,stroke:#334155,color:#fff
style C1 fill:#15803d,stroke:#15803d,color:#fff
style C2 fill:#15803d,stroke:#15803d,color:#fff
style C3 fill:#15803d,stroke:#15803d,color:#fff
style C4 fill:#15803d,stroke:#15803d,color:#fff
## 技术栈概览
flowchart TB
subgraph 宿主环境["宿主环境 (Obsidian)"]
A1[Electron App]
A2[Workspace API]
A3[Vault 文件系统]
end
subgraph 插件层["插件层 (TypeScript)"]
B1[main.ts 入口]
B2[ClaudianView 视图]
end
subgraph 核心层["核心层 (Core)"]
C1[ClaudianService
SDK封装]
C2[AgentManager]
end
subgraph 外部服务["外部服务"]
E1[Anthropic API]
E2[Claude CLI]
end
A1 --> B1
B1 --> C1
C1 --> E1
C1 --> E2
style E1 fill:#0ea5e9,stroke:#0ea5e9,color:#fff
style E2 fill:#f59e0b,stroke:#f59e0b,color:#fff
style A1 fill:#334155,stroke:#334155,color:#fff
style A2 fill:#334155,stroke:#334155,color:#fff
style A3 fill:#334155,stroke:#334155,color:#fff
style B1 fill:#1e293b,stroke:#334155,color:#fff
style B2 fill:#1e293b,stroke:#334155,color:#fff
style C1 fill:#1e293b,stroke:#334155,color:#fff
style C2 fill:#1e293b,stroke:#334155,color:#fff
## 核心数据流转
sequenceDiagram
actor U as 用户
participant O as Obsidian
participant P as Claudian插件
participant S as ClaudianService
participant SDK as Agent SDK
participant API as Anthropic API
U->>O: 1. 打开侧边栏
O->>P: 2. 激活ClaudianView
P->>S: 3. 初始化服务
U->>P: 4. 输入消息 + @引用笔记
P->>P: 5. 解析@提及
P->>O: 6. 读取引用的笔记内容
O-->>P: 7. 返回笔记内容
P->>S: 8. 发送消息(含上下文)
S->>SDK: 9. 调用query()
SDK->>API: 10. HTTP请求
loop 流式响应
API-->>SDK: 11. SSE数据流
SDK-->>S: 12. 流式回调
S-->>P: 13. 更新UI
P-->>U: 14. 显示响应
end
alt 需要工具调用
API-->>SDK: 15. tool_use请求
SDK-->>S: 16. 工具调用事件
S->>P: 17. 请求权限
P->>U: 18. 显示确认对话框
U->>P: 19. 确认执行
P->>O: 20. 执行工具操作
O-->>P: 21. 返回结果
P->>S: 22. 发送工具结果
S->>SDK: 23. 继续对话
end