capsuledevelopment
预览截图
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "capsuledevelopment":https://skillpi.com/zh/skills/deepskill-5b1af81e72a95cf1162245b4072d3f330ba946b62f1a31112a5def21ea494251。安装前核对上游来源和版本:https://github.com/unicity-aos/aos-ce。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
用于构建、测试、打包、安装和调试当前的 Unicity AOS 胶囊。
介绍来源: third_party · unicity-aos · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 构建、测试、包装、安装和调试当前 Unility AOS 胶囊
- 适合谁
- 来源文档未说明。
- 输入和输出
- 来源文档未说明。
- 软件、账号及付费要求
- 来源文档未说明。
- 限制与区别
- 来源文档未说明。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: Capsule Development
description: Build, test, package, install, and debug a current Unicity AOS capsuleCapsule Development
A capsule is a Rust WebAssembly component that runs inside the Astrid Runtime sandbox shipped by Unicity AOS. The runtime routes IPC, enforces capabilities, mediates host access, and audits execution. Business logic belongs in capsules.
The manifest is part of the security boundary. Its [publish] and [subscribe]
tables are the IPC access-control list: a topic that is not declared is denied.
Capsules target wasm32-unknown-unknown, not WASI, and reach the host only through
the audited SDK/WIT imports granted by the manifest.
Start from the supported scaffold
aos capsule new my-capsule
cd my-capsule
The generated project contains:
my-capsule/
├── .cargo/config.toml
├── rust-toolchain.toml
├── Cargo.toml
├── Capsule.toml
└── src/lib.rs
Do not begin from an old [[interceptor]] manifest or an ipc_publish /
ipc_subscribe capability array. Those formats are obsolete.
Compiler target
.cargo/config.toml selects the capsule target and activates the SDK's custom
randomness backend:
[build]
target = "wasm32-unknown-unknown"
[target.wasm32-unknown-unknown]
rustflags = ["--cfg=getrandom_backend=\"custom\""]
The getrandom_backend setting must live in the final capsule crate. Without it,
dependencies such as UUID generators or randomized hash maps can fail to link.
Pin the toolchain and target in rust-toolchain.toml:
[toolchain]
channel = "1.94.0"
targets = ["wasm32-unknown-unknown"]
components = ["rustfmt", "clippy"]
Cargo package
Use a cdylib and the current 0.7 SDK surface:
[package]
name = "my-capsule"
version = "0.1.0"
edition = "2024"
publish = false
[lib]
crate-type = ["cdylib"]
[dependencies]
astrid-sdk = { version = "0.7", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
strip = true
panic = "abort"
Capsule manifest
This minimal tool capsule exposes one hello tool:
[package]
name = "my-capsule"
version = "0.1.0"
description = "A small example capsule"
authors = ["Your Name <you@example.com>"]
astrid-version = ">=0.7.0"
[[component]]
id = "my-capsule"
file = "my_capsule.wasm"
type = "executable"
[capabilities]
fs_read = ["home://data/my-capsule/"]
fs_write = ["home://data/my-capsule/"]
[publish]
"tool.v1.execute.*.result" = { wit = "@unicity-astrid/wit/types/tool-call-result" }
"tool.v1.response.describe.*" = { wit = "@unicity-astrid/wit/tool/describe-response" }
[subscribe]
"tool.v1.execute.hello" = { wit = "@unicity-astrid/wit/types/tool-call", handler = "tool_execute_hello" }
"tool.v1.request.describe" = { wit = "@unicity-astrid/wit/tool/describe-request", handler = "tool_describe" }
Skills are agent user-space instructions, not a Capsule.toml protocol. Ship a trigger Skill through the host plugin or the agent-level Skills service, and expose capsule-owned reference material through typed IPC tools when useful. Do not add an agent Skill section to the manifest or request filesystem write authority merely to modify a host's instruction directory.
The published @unicity-astrid/wit/... strings and astrid:* WIT namespaces
are stable runtime identifiers. Keep them exact even though the product CLI is
aos.
For a tool capsule, both publish entries are required: one returns tool results,
and the other answers the describe fan-out that makes tools visible to agents.
Every tool needs its own concrete execute subscription. A subscribe wildcard may
have one trailing *; publish permissions should be as narrow as practical.
Manifest data is untrusted input. Do not put operator authority, principal identity, or a secret scope in a capsule-controlled field. The kernel stamps the caller identity and decides operator-only policy.
Implement a tool
#![deny(unsafe_code)]
#![deny(clippy::all)]
use astrid_sdk::prelude::*;
use astrid_sdk::schemars;
use serde::Deserialize;
#[derive(Default)]
pub struct MyCapsule;
#[derive(Debug, Default, Deserialize, schemars::JsonSchema)]
pub struct HelloArgs {
/// Person to greet.
pub name: String,
}
#[capsule]
impl MyCapsule {
/// Greet a person by name.
#[astrid::tool("hello")]
pub fn hello(&self, args: HelloArgs) -> Result<String, SysError> {
Ok(format!("Hello, {}!", args.name))
}
}
The tool macro derives the input schema from JsonSchema, uses the method's doc
comment as the tool description, exports tool_execute_hello, and contributes
the generated tool_describe handler. The manifest binds those generated export
names to their IPC topics.
Use #[astrid::interceptor("handler_name")] only when you need a raw handler;
bind that handler from a [subscribe] entry. The obsolete manifest-level
[[interceptor]] table must not be used.
State and lifecycle
Use #[capsule(state)] when mutable capsule state must be persisted by the
runtime. State is scoped to the capsule and principal; never cache per-principal
configuration in a process-global static.
Lifecycle hooks are explicit:
#[astrid::install]runs on first install and may create initial VFS data or elicit configuration.#[astrid::upgrade]migrates state when an installed version is replaced.#[astrid::run]owns a long-running loop and must callruntime::signal_ready()after initialization.
An install hook returns Result<(), SysError>. An upgrade hook also receives the
previous version. Keep migrations idempotent and fail closed before partially
rewriting persisted state.
IPC
Use typed JSON helpers when the contract is JSON:
ipc::publish_json("my.v1.event.ready", &payload)?;
let subscription = ipc::subscribe("my.v1.request.*")?;
let batch = subscription.recv(500)?;
for message in batch.messages {
// Parse and handle each envelope independently.
}
recv(timeout) returns Ok with an empty message batch on timeout. It does not
return a timeout error. A received batch can contain multiple publishers; for a
sensitive operation, read the kernel-stamped principal from each envelope and
require verified attribution. Never trust a principal copied into the payload.
Fan-out responses must be published on their declared response topics. Returning a value from one interceptor does not publish it to other subscribers.
Runtime-mediated host access
Host access is denied unless the manifest and runtime grant it.
fsaccepts VFS paths such ashome://andcwd://; it does not expose raw host paths.kvis automatically scoped by capsule and principal.httpperforms outbound requests only when the capsule has the required HTTP authority.env::varresolves ordinary configuration or an owning capsule's secret at call time. Secrets are not ordinary env JSON and must never be cached across principals.logemits structured capsule logs under~/.aos/runtime/home/<principal>/.local/log/<capsule>/.
Ask only for the narrow paths, hosts, topics, and processes the capsule needs. Do not add broad authority merely to make a failing test pass.
Build, package, and install
rustup target add wasm32-unknown-unknown
aos capsule build
aos capsule install ./dist/my-capsule.capsule
aos capsule list
aos status
aos capsule build packages the component and manifest into an installable,
content-addressed dist/*.capsule artifact. Plain cargo build --release is a
useful compile check, but its raw .wasm output is not installable. Do not copy a
raw WASM file into the runtime home.
There is no hot reload. Rebuild and reinstall the .capsule artifact for each
iteration. Installation replaces the previous installed version while preserving
configuration unless removal is explicitly purged:
aos capsule remove my-capsule
aos capsule remove my-capsule --purge
Test before installation
Keep parsing, validation, and business rules in ordinary Rust functions so they can run in host-target unit tests. Separately validate the guest surface:
cargo fmt --all -- --check
cargo check
aos capsule build
Then install into an isolated AOS home and test the real boundary:
- Confirm the capsule appears in
aos capsule list. - Confirm
aos statusremains healthy. - Exercise every declared tool with valid and invalid input.
- Prove undeclared IPC topics and host operations are denied.
- Test a second principal so configuration and state cannot bleed across callers.
- Revoke access and prove the next invocation observes the revocation.
- Reinstall and upgrade to prove state migration and configuration retention.
Common failures
| Symptom | Check |
|---|---|
| Tool is absent | Declare the execute and describe subscriptions plus both result/describe publish topics. |
| Linker fails around randomness | Restore the custom getrandom_backend rustflag in .cargo/config.toml. |
| IPC publish or subscribe is denied | Add the exact topic to [publish] or [subscribe]; do not add an unrelated wildcard. |
Build produced only .wasm |
Run aos capsule build and install the artifact from dist/. |
| Request times out without an error | Treat an empty recv batch as timeout. |
| One user's configuration appears for another | Remove static/global env caching and resolve per invocation. |
| Capsule panics or exits | Inspect the per-principal capsule log and remove unwrap/expect from guest error paths. |
| Upgrade corrupts state | Make the migration idempotent and write the new state only after validation succeeds. |
For a generated, code-grounded starting point, prefer aos capsule new and the
capsule-forge tooling over copied examples from older releases.
版本历史
-
2026.10.1
GitHub ↗
原版更新说明
Unicity AOS Community Edition 2026.10.1. This product release bundles Astrid Runtime v2026.10.1. The exact runtime release identity, WIT commit, and compatibility pins are published in `runtime-compatibility.toml` and in every archive's `release-manifest.json`. The release also contains the 22 signed, installable capsule artifacts selected by Community Edition. Published `astrid-capsule-*` identities remain unchanged. Install this exact release: ```sh curl --proto '=https' --tlsv1.2 -fsSL https://aos.unicity.ai/install.sh | sh -s -- --version 2026.10.1 ``` Moving channel installs change only after a separate protected promotion. ### Fixed - Run approved shell commands with Bash when available and POSIX `sh` on minimal hosts without Bash, including Alpine. Foreground and background commands keep their existing approval and sandbox boundaries. - After installing on Linux, run the packaged runtime's host setup check and report missing native prerequisites as an installation failure with recovery instructions. Keep the installed package available for repair and retry. - Bundle Astrid 2026.10.1 with its native runtime-media isolation, Linux multi-user startup, host setup, workspace rename and Apple Node repairs.
-
2026.10.0
GitHub ↗
原版更新说明
Unicity AOS Community Edition 2026.10.0. This product release bundles Astrid Runtime v2026.10.0. The exact runtime release identity, WIT commit, and compatibility pins are published in `runtime-compatibility.toml` and in every archive's `release-manifest.json`. The release also contains the 22 signed, installable capsule artifacts selected by Community Edition. Published `astrid-capsule-*` identities remain unchanged. Install this exact release: ```sh curl --proto '=https' --tlsv1.2 -fsSL https://aos.unicity.ai/install.sh | sh -s -- --version 2026.10.0 ``` Moving channel installs change only after a separate protected promotion. ### Added - Add a shared software-update inventory to Command Center and `aos console`, with signed-channel checks, explicit candidate-bound AOS/Oracle installation, per-item failures, and honest activation status. Principal-scoped capsule discovery keeps distribution-managed capsules out of independent updates. - Expand the canonical Oracle event and policy-routing surface so host adapters can forward native client events through the same AOS hook adapter. Client recognition and protocol translation remain in Oracles, not AOS or Astrid. ### Changed - Treat Finder/FSKit mounting as optional on Darwin. Product install no longer fails closed when the host is older than the bundled `AstridFS.app` `LSMinimumSystemVersion` (currently 26.0); native volume mounts still require that minimum and extension approval. - Skip copying `AOS Command Center.app` into `~/Applications` when the host is older than the tray bundle `LSMinimumSystemVersion` (currently 13.0). The CLI still installs; the app remains in the release `share/` directory. ### Fixed - Reapply or recover the bundled distro after a product/runtime upgrade by verifying the retained signed distro and checking the prior receipt under the same signing key and principal; failed applies preserve the prior receipt. Distro Apply requires the selected packaged runtime and refuses foreign runtime overrides before dispatch. - Both AOS version commands identify the product and bundled Astrid runtime. Automatic update checks follow the installed release train and never advertise an older stable release as an upgrade. - Reuse authenticated installer downloads and intact installations, repair missing or mode-damaged managed files, and report progress on slow transfers. Retain the verified Sigstore tool across authenticated installer handoffs. - Recover a crashed console's identity-linked approval socket under an exclusive owner lock, without replacing live consoles or unattributed sockets. - Reclaim an interrupted installer's same-version release staging and backup directories after a successful retry, preserving live owners and backups that have not been superseded. - Wait for the native hook adapter to become ready after a cold runtime start before routing the first host hook. - Return authenticated nested provider failures promptly, including tool calls resumed after approval, and allow healthy calls to continue on the same connection. Older runtimes retain bounded timeout compatibility. - Select the product runtime workspace consistently when starting or attaching from different project directories, without changing relative file arguments or the agent's MCP project context. Requires the corresponding Astrid daemon workspace selector in the bundled runtime. - Preserve authenticated policy decisions across the Oracle relay instead of treating context text as a blocking decision. - Batch fast provider text while preserving ordered delivery and reject stale turn replies after cancellation or replacement. - Select the product workspace for principal discovery instead of accidentally inspecting the caller's unrelated project layout. - Keep cold MCP tool discovery open through its bounded collection deadline, including providers delayed behind other capsule calls. Warm cached discovery stays immediate; receive failures are reported instead of called complete. - Grant the default CE fleet during the first `astrid init` instead of spawning a second runtime CLI after capsules are installed. - Do not mistake regular Finder `.DS_Store` metadata for unfinished runtime shutdown; genuine leftover state and redirected entries still block confirmation. - Support Apple-ID app-specific-password notarization for Command Center release signing; retain API-key and keychain-profile support in the helper.
-
2026.9.3
GitHub ↗
原版更新说明
Unicity AOS Community Edition 2026.9.3. This product release bundles Astrid Runtime v2026.9.4. The exact runtime release identity, WIT commit, and compatibility pins are published in `runtime-compatibility.toml` and in every archive's `release-manifest.json`. The release also contains the 22 signed, installable capsule artifacts selected by Community Edition. Published `astrid-capsule-*` identities remain unchanged. Install this exact release: ```sh curl --proto '=https' --tlsv1.2 -fsSL https://aos.unicity.ai/install.sh | sh -s -- --version 2026.9.3 ``` Moving channel installs change only after a separate protected promotion. ### Added - Add `aos console` on Unix: a keyboard/mouse Command Center for permission decisions and masked private input. Connected console approvals return prompt pending MCP results with directions to the correct local or remote AOS home; a read-only status tool retrieves the original result without replaying work. - Add a developer-preview macOS AOS menu-bar app with permission dialogs, typed private-input forms, runtime overview, searchable capsule inventory and owned-principal selection. Explicit local setup pairs a dedicated responder; disconnection and cancellation never approve. - Package Darwin `share/AOS Command Center.app` from `AOS_COMMAND_CENTER_APP` and copy it unchanged into both the immutable release directory and the current user's Applications directory when present. The installer opens the stable app, it registers as a login item, and `aos start`/`restart` plus Oracle-facing `aos mcp serve` sessions reopen it so native approval and input requests have a visible presenter. Archives without the member still install. Developer preview builds are not packaged GO. - Intercept modern MCP `input_required` results in `aos mcp serve` native, auto (when the client lacks forms), and deny modes. The original `tools/call` is resumed to the runtime with echoed `requestState`; incomplete results stay off the host stream. - Optional `aos mcp serve --interaction-socket PATH` for native tray presentation over a same-user Unix socket. Requires `--interaction native` and does not fall back to AppKit or the MCP host. The tray prompt deadline defaults to 120 seconds via `--interaction-timeout` and is distinct from `--request-timeout`, which is forwarded to the runtime. - Bound native MRTR tracking with `--max-in-flight-calls` (default 32) and `--max-input-rounds` (default 8). Excess unique calls fail closed without dropping already-tracked requests. Exhausted input rounds complete the tracked call, return a JSON-RPC internal error to the host, and cancel the runtime request. ### Fixed - Repair permissions in existing legacy `runtime/secrets`, `runtime/home`, and `runtime/cow` trees during upgrade so pre-2026.9 homes satisfy Astrid's owner-only private-root contract without creating or following unsafe entries. - No-args AOS Tray launch binds the current user's `~/.aos/bin/aos` and `~/.aos`, or a valid absolute `AOS_HOME`, instead of leaving Finder launches unable to inventory or set up native input. `PATH` search, app-adjacent binaries, and silent pairing remain out of scope. - Failed native-input setup now removes only files this attempt created and refuses preexisting device-key sidecars instead of deleting them. A successful pairing redeem is not rolled back in the daemon. - Native-input setup canonicalizes macOS `/tmp` home aliases before pairing and binds setup receipts to the requested principal and expected connection path. - Bind MCP tool results to the kernel-stamped identity selected during tool discovery as well as the call ID, including calls resumed after approval. - Preserve partial MCP frames when bidirectional reads are interrupted, rather than discarding the already-read prefix before the next read. - Return locally handled MCP approval replies to the requesting runtime, rather than emitting them to the agent host and leaving the runtime waiting. - Fail `aos mcp serve` closed when a native-tracked `tools/call` reuses an in-flight JSON-RPC id or is malformed, instead of forwarding it and resuming the original call.
-
2026.9.2
GitHub ↗
原版更新说明
Unicity AOS Community Edition 2026.9.2. This product release bundles Astrid Runtime v2026.9.2. The exact runtime release identity, WIT commit, and compatibility pins are published in `runtime-compatibility.toml` and in every archive's `release-manifest.json`. The release also contains the 22 signed, installable capsule artifacts selected by Community Edition. Published `astrid-capsule-*` identities remain unchanged. Install this exact release: ```sh curl --proto '=https' --tlsv1.2 -fsSL https://aos.unicity.ai/install.sh | sh -s -- --version 2026.9.2 ``` Moving channel installs change only after a separate protected promotion. ### Changed - Bundle Astrid 2026.9.2, adding optional authenticated MCP Streamable HTTP transport and honoring the selected workspace configuration for that transport. Existing stdio host integration and Community capsule selection are unchanged. - Update the exact runtime and client-library pins while retaining GNU, musl, and macOS filesystem providers and authenticated runtime metadata.
-
2026.9.1
GitHub ↗
原版更新说明
Unicity AOS Community Edition 2026.9.1. This product release bundles Astrid Runtime v2026.9.1. The exact runtime release identity, WIT commit, and compatibility pins are published in `runtime-compatibility.toml` and in every archive's `release-manifest.json`. The release also contains the 22 signed, installable capsule artifacts selected by Community Edition. Published `astrid-capsule-*` identities remain unchanged. Install this exact release: ```sh curl --proto '=https' --tlsv1.2 -fsSL https://aos.unicity.ai/install.sh | sh -s -- --version 2026.9.1 ``` Moving channel installs change only after a separate protected promotion. ### Changed - Bundle Astrid 2026.9.1 for initialization, resumed grants, durable capsule preservation across shutdown, clean daemon retirement, and native capsule subprocess input fixes. GNU, musl, and Darwin keep their filesystem providers. ### Fixed - Allow Community and Oracle host setup without an OpenAI API key. Provider credentials can be configured when needed; host MCP tools do not require them. - Read principal-scoped loaded capsule metadata for system inspection instead of an obsolete private capsule directory. Shared executable hashes remain references; missing metadata is reported instead of silently omitted.
此处仅展示最近 5 个版本。 在原站查看完整版本历史 ↗
当前收录版本
0.0.1
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供完整的 Unicity AOS 胶囊开发生命周期指导
- 涵盖从 scaffold 初始化到生产部署的全流程
- 面向专业 WASM 组件开发场景,具有明确实用价值
亮点
- description 清晰定义功能范围
- 触发词覆盖构建、测试、打包、安装、调试等关键动作
- 边界明确,无歧义
亮点
- Phase 划分清晰,逻辑递进
- 每步含具体命令、配置和代码示例
- frontmatter 完整,文档结构规范
亮点
- 工具链版本和参数配置准确
- Common failures 表格覆盖典型错误场景
- 强调安全边界和权限最小化原则
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
来源文档未说明。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。