← Starchild Wiki

Platform Architecture平台架构

One persistent agent per user — a real machine, not a stateless chat session每个用户一个持久 agent——一台真实的机器,而不是无状态的聊天会话

container · workspace · sc-proxy · channels

01A machine, not a session机器,而非会话

Each agent is a real machine with its own filesystem, shell, and process tree — not a stateless chat session recreated for every message.每个 agent 都是一台真实的机器,有自己的文件系统、shell 与进程树——而不是为每条消息重建的无状态聊天会话。

The container survives restarts. Files in workspace/ persist: setup.sh installs what the agent needs, .env holds its secrets, and the agent's own output stays in place. The platform image updates underneath without touching user data.容器在重启后依然存在。workspace/ 里的文件持久保留:setup.sh 安装 agent 所需的一切,.env 存放它的密钥,agent 自己的产出也原地保留。平台镜像在底层自动更新,不碰用户数据。

Idle machines suspend; activity wakes them. The identity is one agent, not one thread: the same agent answers on Web, Telegram, WeChat, and Feishu, sharing one memory and one workspace across every channel.空闲的机器会挂起,一有活动便唤醒。身份是「一个 agent」,而不是「一个线程」:同一个 agent 在 Web、Telegram、微信、飞书上应答,所有渠道共享一份记忆、一个工作区。

Suspending costs almost nothing, and waking takes seconds; the price of persistence is small enough to pay for every agent, always.挂起几乎不花成本,唤醒只需几秒;持久化的代价小到可以为每个 agent 永远支付。

02Credential injection via sc-proxysc-proxy 凭证注入

Outbound API calls never carry the user's keys. They pass through sc-proxy, which injects the real credentials server-side before forwarding.出站 API 调用从不携带用户的密钥。它们经由 sc-proxy,由服务端在转发前注入真实凭证。

User keys live in workspace/.env and are collected only through secure input — never through chat. The agent sees tokens as names, and sc-proxy resolves them at the edge.用户密钥存放在 workspace/.env,只通过安全输入收集——绝不经由聊天。agent 看到的只是令牌名,由 sc-proxy 在边缘解析。

Every call carries a caller ID — job:/chat:/preview: — so cost is attributed per feature. “Which job is eating my credits” stops being a mystery and becomes a query.每次调用都带一个调用方 ID——job:/chat:/preview:——成本按功能归因。「哪个任务在吃我的额度」不再是谜,而只是一个查询。

Because credentials never appear in the agent's own output or logs, a compromised conversation leaks nothing worth stealing.因为凭证从不出现在 agent 自己的输出或日志里,一个被攻破的对话也泄露不出值得偷的东西。

03Deferred tools and cache discipline延迟工具与缓存纪律

Tool schemas are expensive prompt real estate. The platform treats them like book pages: an index lives in the prefix, the full text arrives on demand.工具 schema 是昂贵的 prompt 空间。平台把它们当作书页:前缀里只有目录,全文按需送达。

Rarely used tools load as one-line directory entries. The full schema is fetched only when the agent asks — via tool_describe and tool_call. The prompt prefix stays stable, which keeps provider prompt caching hot.不常用的工具只加载一行目录条目。完整 schema 仅在 agent 请求时获取——通过 tool_describetool_call。prompt 前缀保持稳定,provider 的 prompt 缓存因此持续命中。

Mid-conversation tool mutation is forbidden. Adding or changing a tool invalidates the cached prefix and raises the cost of every following turn. Cache discipline is a design constraint, not a tuning knob.会话中途禁止变更工具。新增或修改工具会使缓存的前缀失效,抬高之后每一轮的成本。缓存纪律是设计约束,不是调参旋钮。

The measured result is a stable, cacheable prefix — the difference between per-turn pennies and fractions of a cent.实测结果是前缀稳定且可缓存——这是每轮几分钱与零点几分钱的差别。

04Skills as procedural memorySkills 即程序性记忆

Long-running domain knowledge is not stuffed into the prompt. It ships as skills — markdown workflows loaded on demand.长期领域的知识不会硬塞进 prompt。它以 skills 形式存在——按需加载的 Markdown 工作流。

The agent reads a skill when the task matches it, then executes the tested sequences the skill contains. What a skill is, and how skills are discovered, patched, and published, is the subject of the skills page.agent 在任务匹配时读取 skill,然后执行其中经过验证的步骤。Skill 是什么、如何被发现、修补与发布,见 skills 页面。

Procedural memory sits outside the prompt because it outlives the conversation. A skill learned once is available in every future session, on every channel.程序性记忆放在 prompt 之外,因为它比对话活得久。一次学会的 skill,在未来的每个会话、每个渠道都可用。

05Channels and previews多渠道与预览

The same agent output is rendered differently per channel, and the agent can publish live web pages from its own machine.同一份 agent 输出在不同渠道有不同的渲染方式,agent 还能从自己的机器发布实时网页。

The Web frontend turns tables into charts and renders Mermaid diagrams, LaTeX, and file viewers inline. When the agent runs its own web app, it can publish a public URL through the community system — the workroom becomes reachable, not just reported.Web 前端把表格变成图表,并内联渲染 Mermaid 图、LaTeX 与文件查看器。当 agent 运行自己的 Web 应用时,可通过社区系统发布公开 URL——工作间变得可访问,而不只是被汇报。

Previews follow the same path: what the agent builds locally can be shown as a chart, a diagram, or a live page, without leaving the platform.预览走同一条路:agent 本地构建的东西,可以以图表、图形或实时页面的形式展示出来,而无需离开平台。