capsule-identity README

The project's README from github.com/unicity-aos/capsule-identity. As one markdown file: README.md.

astrid-capsule-identity

License: MIT OR Apache-2.0 MSRV: 1.94

The identity and system prompt builder for Astrid OS.

In the OS model, this capsule is /etc/profile. It owns the agent's spark identity, persists it as capsule state, and assembles the identity plus environment context into a system prompt.

How it works

On a spark.v1.request.build event:

  1. Loads the persisted spark identity from capsule KV state.
  2. Auto-detects home://.config/spark.toml if KV state is empty.
  3. Adds environment context (working directory, platform).
  4. Publishes the assembled prompt on spark.v1.response.ready.

If no identity exists yet, the prompt includes onboarding instructions. After onboarding, the LLM calls save_identity, which saves the chosen callsign, class, aura, signal, and core directives to capsule state and writes home://.config/spark.toml as a recovery copy.

State is scoped by Astrid's capsule KV isolation for the calling principal. Session ID is echoed back for react loop correlation.

IPC protocol

Direction Topic
Subscribe spark.v1.request.build
Subscribe tool.v1.execute.save_identity
Subscribe tool.v1.request.describe
Subscribe cli.v1.command.execute
Publish spark.v1.response.ready
Publish tool.v1.execute.*.result
Publish tool.v1.response.describe.*
Publish agent.v1.response

Development

cargo build
cargo test

License

Dual-licensed under MIT and Apache 2.0.

Copyright (c) 2025-2026 Joshua J. Bouw and Unicity Labs.

capsule-identity (unicity-aos/capsule-identity)

Searching Database…

这是什么?它是 Astrid OS(Unicity AOS 的一部分)的系统提示词构建胶囊,负责管理智能体的 “spark” 身份,将其与工作区和环境上下文合并,并组装出 LLM 接收的最终系统提示词。
这是独立应用,还是更大系统的一部分?它是一个胶囊,即 Astrid OS 胶囊架构中的模块化 IPC 服务。README 把它类比为普通操作系统中的 /etc/profile。它只能作为 Astrid OS / Unicity AOS 的组件运行,无法单独使用。
我该怎么让它运行起来?无需手动启动。当 Astrid OS 发出 spark.v1.request.build 事件时它会激活,然后从胶囊 KV 状态中加载已保存的身份,或从 home://.config/spark.toml 自动检测身份。
使用它是否必须先安装 Astrid OS?是的,它完全依赖 Astrid OS 的胶囊 KV 状态和发布/订阅 IPC 总线。它会订阅 spark.v1.request.build 和 tool.v1.execute.saveidentity 等主题,没有独立的运行时。
第一次使用、还没设置任何身份时会发生什么?如果尚未保存任何身份,组装出的提示词会包含引导说明,让智能体带你依次选择呼号、职业、气场、信号和核心准则。
引导过程中会保存哪些身份字段?引导过程中,LLM 会调用 saveidentity,保存呼号、职业、气场、信号和核心准则,然后将一份恢复副本写入 home://.config/spark.toml。
这个胶囊如何与 Astrid OS 的其他部分通信?完全通过发布/订阅 IPC 进行通信:它监听 spark.v1.request.build 和 tool.v1.execute.saveidentity 等事件,并将组装好的提示词发布到 spark.v1.response.ready。
为什么要把它类比为 /etc/profile?就像 /etc/profile 在 shell 会话开始时进行初始化一样,这个胶囊会在每次会话开始时初始化智能体的身份和环境上下文,并回传会话 ID 以便循环关联。
Size
0.2 MB
Stars
8.4K
Age
7mo
Commits · 90 Days