
router
TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.
It combines a full React Native interface with deep Android native modules (AccessibilityService, Shizuku, IME) to create an on-device AI agent that can observe and control the phone, execute shell commands, and run autonomously, all while employing advanced techniques like prompt caching and streaming fault tolerance.
YSClaude 是一个 Android 优先的个人 AI Agent 工作台。它以对话为入口,将大模型推理、工具调用、长期记忆、子 Agent、自动化工作流与 Android 系统能力组织成一个可持续运行的移动端 Agent Runtime。
项目并非简单的 Chat UI:模型可以在多轮执行循环中搜索记忆、操作网页、读写 Artifact、调用 MCP Server、派发子 Agent,并通过 Kotlin 原生模块观察和控制 Android 设备。
flowchart LR
subgraph MessageFlow["消息流"]
U["用户输入 / 系统触发"] --> Store["useChatStore落库并组装上下文"]
Store --> API["OpenAI-compatible APISSE 流式响应"]
end
subgraph AgentLoop["Agent 执行引擎"]
API --> Parse{"解析模型输出"}
Parse -->|"文本增量"| Render["更新 assistant 消息"]
Parse -->|"tool_calls"| Calls["校验并记录工具调用"]
Result["工具结果 / 错误"] --> ToolMessage["追加 tool 消息"]
ToolMessage --> API
end
subgraph Dispatch["工具分发"]
Calls --> Router["executeTool匹配 ToolModule"]
Router --> JSTools["JS / 远程工具记忆 · MCP · Web · Artifact · 子 Agent"]
Router --> NativeTools["设备工具屏幕 · 输入 · Shell · 通知 · 文件"]
JSTools --> Result
end
subgraph NativeBridge["React Native → Android 原生桥"]
NativeTools --> Service["TypeScript Service 封装"]
Service --> Bridge["NativeModules / AIDL"]
Bridge --> Kotlin["Kotlin Modules & Services"]
Kotlin --> Android["AccessibilityService · IMEShizuku · Foreground Service"]
Android --> NativeResult["结构化执行结果"]
NativeResult --> Result
end
Render --> Persist["SQLite 持久化"]
Render --> Output["UI / TTS / 通知"]
Agent 主循环位于 src/stores/chat.ts。它负责把模型、消息、工具和 UI 状态组织成一个可中断、可追踪的执行过程:
构造稳定 Prompt、历史消息和运行时上下文
→ 发起流式 Chat Completion
→ 实时写入文本和 Thinking 内容
→ 收集并重组 tool_calls
→ 执行工具并生成 tool message
→ 携带执行结果继续请求模型
→ 无工具调用、用户中止或达到调用上限后结束
不同工具的合理调用深度不同。引擎根据当前启用能力动态计算本轮上限,例如记忆检索、MCP、网页交互、远程命令和 Android 控制分别提供自己的 maxToolCalls 配置。循环同时记录累计调用次数,避免模型陷入无限工具调用。
每轮 tool_calls 会以 assistant 消息写回上下文,执行结果则按 OpenAI 协议附带 tool_call_id 追加为 tool 消息,从而维持完整的因果链。工具调用状态还会同步到 ToolInvocation,支持 UI 实时展示和历史回放。
普通工具默认串行执行,避免文件读写、页面操作等工具之间的隐式依赖被破坏。当同一批调用全部为 `di
YSClaude Expo/React Native Android AI assistant client
Similar projects matched by category, topics, and programming language.

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.
scriptc compiles ordinary TypeScript into small, fast native executables without needing Node.js, V8, or any JavaScript runtime in the binary.
A React component library that renders six hand-tuned animated thought orb loading indicators on a plain 2D canvas, with two purpose-tuned sizes and automatic theme detection for AI and agent UIs.