Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ jobs:
shell: bash
run: |
set -euo pipefail
# Pull requests check the synthetic merge ref in detached HEAD.
# Version/lockfile auto-patching is a main-branch operation; on PRs
# simply pass the checked-out merge SHA to downstream jobs instead of
# attempting to rebase and push from a detached checkout.
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "build_ref=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
exit 0
fi
FULL_VERSION=$(grep '^version = ' phira-mp-plus-server/Cargo.toml | sed 's/.*"\(.*\)"/\1/')
MAJOR=$(echo "$FULL_VERSION" | cut -d. -f1)
MINOR=$(echo "$FULL_VERSION" | cut -d. -f2)
Expand Down Expand Up @@ -144,4 +152,3 @@ jobs:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact-path }}
if-no-files-found: error

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Phira-mp-plus/
├── README.md
├── server_config.yml # YAML 配置文件
├── wit/ # WIT 接口定义
│ └── phira-plugin.wit # Plugin ABI v2 WIT (15 interfaces)
│ └── phira-plugin.wit # Plugin ABI v3 WIT (16 interfaces)
│
├── scripts/
│ └── docgen.sh # WIT → Markdown 文档生成脚本
Expand Down Expand Up @@ -438,4 +438,4 @@ Phira-mp+ 整体采用 **Apache License, Version 2.0** — 详见 [LICENSE](LICE



![:name](https://count.getloli.com/@:phira-mp-plus-md)
![:name](https://count.getloli.com/@:phira-mp-plus-md)
2 changes: 1 addition & 1 deletion docs/development/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ PMP → wasmtime (component model)
→ quarantine 故障隔离
```

插件通过 WIT ABI v2 定义 host API,每插件独立 capability 声明。
插件通过 WIT ABI v3 定义 host API,每插件独立 capability 声明。

## 关键不变量

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ PMP 插件状态机:`加载 → 验证 → 启用 → 运行 → 禁用 →
| `tcp` | 发起 TCP 连接 |
| `max_concurrent_calls` | 并发 API 调用数(默认 1) |

缺省授予 `default_capabilities` 集合(`state.read`、`send`、`ext`、`config`、`http`、`room.manage`、`admin`、`crypto`、`timer`、`tcp`、`room-state` 等)——manifest 声明的能力用于显式覆盖/收紧。**动态**能力请求(`request-capability`)默认拒绝。
缺省仅授予 `default_capabilities` 的低权限集合(`state.read`、`send`、`ext`、`config`、`timer`、`room-state`)。HTTP、TCP、文件、加密、handler、插件调用、房间管理和管理员能力必须由 manifest 显式授予。**动态**能力请求(`request-capability`)默认拒绝。

### 构建与部署

Expand Down
29 changes: 18 additions & 11 deletions phira-mp-plus-server/src/benchmark/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ pub struct BenchmarkHarness {
}

impl BenchmarkHarness {
pub fn new(
state: Arc<PlusServerState>,
params: ModeParams,
status: Arc<CliStatus>,
) -> Self {
pub fn new(state: Arc<PlusServerState>, params: ModeParams, status: Arc<CliStatus>) -> Self {
Self {
state,
params,
Expand Down Expand Up @@ -133,10 +129,7 @@ impl BenchmarkHarness {
None,
);
self.state.users.write().await.insert(id, Arc::new(user));
self.sessions.push(SessionEntry {
user_id: id,
name,
});
self.sessions.push(SessionEntry { user_id: id, name });
id
}

Expand Down Expand Up @@ -175,7 +168,16 @@ impl BenchmarkHarness {
if let Err(e) = self
.state
.room_commands
.add_user(&self.state, &room_id, uid, &name, false, deadline, None)
.add_user(
&self.state,
&room_id,
uid,
&name,
None,
false,
deadline,
None,
)
.await
{
self.errors += 1;
Expand Down Expand Up @@ -231,7 +233,12 @@ impl BenchmarkHarness {

/// 关闭一个房间(teardown / 轮换)。
async fn close_room(&self, room_id: &str) {
if let Err(e) = self.state.room_commands.close_room(&self.state, room_id).await {
if let Err(e) = self
.state
.room_commands
.close_room(&self.state, room_id)
.await
{
tracing::warn!(room = room_id, %e, "bench close_room failed");
}
}
Expand Down
Loading
Loading