Przeglądaj źródła

【新增】实现 PageOS 核心框架的网页服务功能

- 新增网页服务器模块,监听 12800 端口
- 实现静态文件服务,支持 HTML、CSS、JS 等资源
- 采用 Warp 框架构建高性能异步服务器
- 默认服务用户主目录下的 .local/share/pageos 目录
- 添加启动服务器时的提示信息
PJ568 1 rok temu
rodzic
commit
80824eb623
11 zmienionych plików z 1577 dodań i 43 usunięć
  1. 4 0
      .gitignore
  2. 40 0
      CONTRIBUTING.md
  3. 1284 1
      Cargo.lock
  4. 5 2
      Cargo.toml
  5. 53 0
      README.en.md
  6. 49 4
      README.md
  7. 44 34
      docs/draft.md
  8. 51 0
      docs/prompt.md
  9. 6 2
      src/main.rs
  10. 3 0
      src/mod/terminal-emulator.rs
  11. 38 0
      src/server.rs

+ 4 - 0
.gitignore

@@ -1 +1,5 @@
 /target
+
+/.vscode
+
+/参考

+ 40 - 0
CONTRIBUTING.md

@@ -0,0 +1,40 @@
+# 贡献指北
+
+## 项目版本管理
+
+我们使用[语义化版本](https://semver.org/lang/zh-CN/)进行版本管理。
+任何对代码库的更改都不应使用现有版本发布。
+
+## 提交信息格式
+
+提交信息应遵循 [PJ568 提交说明规范](https://github.com/PJ-568/git-commit-regulation)。
+
+## 提交更改
+
+1. Fork 此仓库,在您的仓库新建一个基于此仓库默认分支(branch)的分支。
+2. 在该新建分支对项目进行更改,确保语法不存在问题后应用更改您的仓库。
+3. 向我们的仓库提交拉取请求。请确保您遵循了上述说明。
+4. 我们将定期审查拉取请求,并告知您我们的问题以及在合并您的拉取请求之前需要进行的任何更改。
+5. 我们希望您在 15 日内作出回应,之后如果没有显示活动,您的拉取请求可能会被关闭。
+
+### 参考流程
+
+1. Fork 源码,下载到本地并运行项目;
+2. 添加或修改代码;
+3. 配置 rust 环境并运行 `cargo check` 对修改的代码进行静态检查;
+4. 对相关改动进行全面的自我测试;
+5. 确认无误后提交修改到 Github;
+6. 提交 Pull Request。
+
+### 注意事项
+
+- 单次 Pull Request 不应提交过多修改,请确保每次提交都针对特定的功能且务必说明本次改动的具体目的,例如:修复某 bug 、优化某方法 等,方便进行 Code Review;
+- 对于 bug 的修复,应该将本次 Pull Request 和相对应 bug 的 issue 关联起来,让别人知道该问题已经被修复;
+- 对于较大的新功能,你需要先提交 Issues,例如 “【新增】添加 XXX 功能”,确认该功能有被添加的必要后,再开始工作;
+- 对于一些主观的样式、交互逻辑调整:如颜色、图标的使用,某些预设配置的增减修改等,一般不予通过。但可以在 Discussions 中进行讨论;
+- 其他如简单的代码优化、文档修正等,只要修改合理都会被接受。
+
+## 设计文档
+
+- [草案](docs/draft.md)
+- [提示词](docs/prompt.md)

+ 1284 - 1
Cargo.lock

@@ -2,6 +2,1289 @@
 # It is not intended for manual editing.
 version = 4
 
+[[package]]
+name = "addr2line"
+version = "0.24.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
+dependencies = [
+ "gimli",
+]
+
+[[package]]
+name = "adler2"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
+
+[[package]]
+name = "autocfg"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
+
+[[package]]
+name = "backtrace"
+version = "0.3.75"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002"
+dependencies = [
+ "addr2line",
+ "cfg-if",
+ "libc",
+ "miniz_oxide",
+ "object",
+ "rustc-demangle",
+ "windows-targets",
+]
+
+[[package]]
+name = "base64"
+version = "0.21.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
+
+[[package]]
+name = "bitflags"
+version = "2.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
+
+[[package]]
+name = "block-buffer"
+version = "0.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
+name = "byteorder"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+
+[[package]]
+name = "bytes"
+version = "1.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
+
+[[package]]
+name = "cpufeatures"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "crypto-common"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
+dependencies = [
+ "generic-array",
+ "typenum",
+]
+
+[[package]]
+name = "data-encoding"
+version = "2.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476"
+
+[[package]]
+name = "digest"
+version = "0.10.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
+dependencies = [
+ "block-buffer",
+ "crypto-common",
+]
+
+[[package]]
+name = "displaydoc"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "encoding_rs"
+version = "0.8.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "equivalent"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
+
+[[package]]
+name = "fnv"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+
+[[package]]
+name = "form_urlencoded"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
+dependencies = [
+ "percent-encoding",
+]
+
+[[package]]
+name = "futures-channel"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+]
+
+[[package]]
+name = "futures-core"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
+
+[[package]]
+name = "futures-sink"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
+
+[[package]]
+name = "futures-task"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
+
+[[package]]
+name = "futures-util"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+ "futures-task",
+ "pin-project-lite",
+ "pin-utils",
+ "slab",
+]
+
+[[package]]
+name = "generic-array"
+version = "0.14.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
+dependencies = [
+ "typenum",
+ "version_check",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "gimli"
+version = "0.31.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
+
+[[package]]
+name = "h2"
+version = "0.3.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d"
+dependencies = [
+ "bytes",
+ "fnv",
+ "futures-core",
+ "futures-sink",
+ "futures-util",
+ "http 0.2.12",
+ "indexmap",
+ "slab",
+ "tokio",
+ "tokio-util",
+ "tracing",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.15.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
+
+[[package]]
+name = "headers"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270"
+dependencies = [
+ "base64",
+ "bytes",
+ "headers-core",
+ "http 0.2.12",
+ "httpdate",
+ "mime",
+ "sha1",
+]
+
+[[package]]
+name = "headers-core"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429"
+dependencies = [
+ "http 0.2.12",
+]
+
+[[package]]
+name = "home"
+version = "0.5.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf"
+dependencies = [
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "http"
+version = "0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
+dependencies = [
+ "bytes",
+ "fnv",
+ "itoa",
+]
+
+[[package]]
+name = "http"
+version = "1.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565"
+dependencies = [
+ "bytes",
+ "fnv",
+ "itoa",
+]
+
+[[package]]
+name = "http-body"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
+dependencies = [
+ "bytes",
+ "http 0.2.12",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "httparse"
+version = "1.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
+
+[[package]]
+name = "httpdate"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
+
+[[package]]
+name = "hyper"
+version = "0.14.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7"
+dependencies = [
+ "bytes",
+ "futures-channel",
+ "futures-core",
+ "futures-util",
+ "h2",
+ "http 0.2.12",
+ "http-body",
+ "httparse",
+ "httpdate",
+ "itoa",
+ "pin-project-lite",
+ "socket2",
+ "tokio",
+ "tower-service",
+ "tracing",
+ "want",
+]
+
+[[package]]
+name = "icu_collections"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47"
+dependencies = [
+ "displaydoc",
+ "potential_utf",
+ "yoke",
+ "zerofrom",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_locale_core"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a"
+dependencies = [
+ "displaydoc",
+ "litemap",
+ "tinystr",
+ "writeable",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_normalizer"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979"
+dependencies = [
+ "displaydoc",
+ "icu_collections",
+ "icu_normalizer_data",
+ "icu_properties",
+ "icu_provider",
+ "smallvec",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_normalizer_data"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3"
+
+[[package]]
+name = "icu_properties"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b"
+dependencies = [
+ "displaydoc",
+ "icu_collections",
+ "icu_locale_core",
+ "icu_properties_data",
+ "icu_provider",
+ "potential_utf",
+ "zerotrie",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_properties_data"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632"
+
+[[package]]
+name = "icu_provider"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af"
+dependencies = [
+ "displaydoc",
+ "icu_locale_core",
+ "stable_deref_trait",
+ "tinystr",
+ "writeable",
+ "yoke",
+ "zerofrom",
+ "zerotrie",
+ "zerovec",
+]
+
+[[package]]
+name = "idna"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e"
+dependencies = [
+ "idna_adapter",
+ "smallvec",
+ "utf8_iter",
+]
+
+[[package]]
+name = "idna_adapter"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
+dependencies = [
+ "icu_normalizer",
+ "icu_properties",
+]
+
+[[package]]
+name = "indexmap"
+version = "2.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
+dependencies = [
+ "equivalent",
+ "hashbrown",
+]
+
+[[package]]
+name = "io-uring"
+version = "0.7.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013"
+dependencies = [
+ "bitflags",
+ "cfg-if",
+ "libc",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
+
+[[package]]
+name = "libc"
+version = "0.2.174"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
+
+[[package]]
+name = "litemap"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956"
+
+[[package]]
+name = "lock_api"
+version = "0.4.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765"
+dependencies = [
+ "autocfg",
+ "scopeguard",
+]
+
+[[package]]
+name = "log"
+version = "0.4.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
+
+[[package]]
+name = "memchr"
+version = "2.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
+
+[[package]]
+name = "mime"
+version = "0.3.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
+
+[[package]]
+name = "mime_guess"
+version = "2.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"
+dependencies = [
+ "mime",
+ "unicase",
+]
+
+[[package]]
+name = "miniz_oxide"
+version = "0.8.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
+dependencies = [
+ "adler2",
+]
+
+[[package]]
+name = "mio"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c"
+dependencies = [
+ "libc",
+ "wasi",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "multer"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2"
+dependencies = [
+ "bytes",
+ "encoding_rs",
+ "futures-util",
+ "http 0.2.12",
+ "httparse",
+ "log",
+ "memchr",
+ "mime",
+ "spin",
+ "version_check",
+]
+
+[[package]]
+name = "object"
+version = "0.36.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.21.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
+
 [[package]]
 name = "pageos-core"
-version = "0.1.1"
+version = "0.2.0"
+dependencies = [
+ "home",
+ "tokio",
+ "warp",
+]
+
+[[package]]
+name = "parking_lot"
+version = "0.12.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13"
+dependencies = [
+ "lock_api",
+ "parking_lot_core",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "smallvec",
+ "windows-targets",
+]
+
+[[package]]
+name = "percent-encoding"
+version = "2.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
+
+[[package]]
+name = "pin-project"
+version = "1.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a"
+dependencies = [
+ "pin-project-internal",
+]
+
+[[package]]
+name = "pin-project-internal"
+version = "1.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
+
+[[package]]
+name = "pin-utils"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
+
+[[package]]
+name = "potential_utf"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585"
+dependencies = [
+ "zerovec",
+]
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
+dependencies = [
+ "zerocopy",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.95"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "rand"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.5.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "de3a5d9f0aba1dbcec1cc47f0ff94a4b778fe55bca98a6dfa92e4e094e57b1c4"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "rustc-demangle"
+version = "0.1.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f"
+
+[[package]]
+name = "ryu"
+version = "1.0.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
+
+[[package]]
+name = "scoped-tls"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
+
+[[package]]
+name = "scopeguard"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+
+[[package]]
+name = "serde"
+version = "1.0.219"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.219"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.141"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"
+dependencies = [
+ "itoa",
+ "memchr",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "serde_urlencoded"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
+dependencies = [
+ "form_urlencoded",
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "sha1"
+version = "0.10.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
+dependencies = [
+ "cfg-if",
+ "cpufeatures",
+ "digest",
+]
+
+[[package]]
+name = "signal-hook-registry"
+version = "1.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "slab"
+version = "0.4.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d"
+
+[[package]]
+name = "smallvec"
+version = "1.15.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
+
+[[package]]
+name = "socket2"
+version = "0.5.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678"
+dependencies = [
+ "libc",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "spin"
+version = "0.9.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
+
+[[package]]
+name = "stable_deref_trait"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
+
+[[package]]
+name = "syn"
+version = "2.0.104"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "synstructure"
+version = "0.13.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "thiserror"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
+dependencies = [
+ "thiserror-impl",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "tinystr"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b"
+dependencies = [
+ "displaydoc",
+ "zerovec",
+]
+
+[[package]]
+name = "tokio"
+version = "1.46.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
+dependencies = [
+ "backtrace",
+ "bytes",
+ "io-uring",
+ "libc",
+ "mio",
+ "parking_lot",
+ "pin-project-lite",
+ "signal-hook-registry",
+ "slab",
+ "socket2",
+ "tokio-macros",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "tokio-macros"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "tokio-tungstenite"
+version = "0.21.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38"
+dependencies = [
+ "futures-util",
+ "log",
+ "tokio",
+ "tungstenite",
+]
+
+[[package]]
+name = "tokio-util"
+version = "0.7.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df"
+dependencies = [
+ "bytes",
+ "futures-core",
+ "futures-sink",
+ "pin-project-lite",
+ "tokio",
+]
+
+[[package]]
+name = "tower-service"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
+
+[[package]]
+name = "tracing"
+version = "0.1.41"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
+dependencies = [
+ "log",
+ "pin-project-lite",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-core"
+version = "0.1.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
+dependencies = [
+ "once_cell",
+]
+
+[[package]]
+name = "try-lock"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
+
+[[package]]
+name = "tungstenite"
+version = "0.21.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1"
+dependencies = [
+ "byteorder",
+ "bytes",
+ "data-encoding",
+ "http 1.3.1",
+ "httparse",
+ "log",
+ "rand",
+ "sha1",
+ "thiserror",
+ "url",
+ "utf-8",
+]
+
+[[package]]
+name = "typenum"
+version = "1.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
+
+[[package]]
+name = "unicase"
+version = "2.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
+
+[[package]]
+name = "url"
+version = "2.5.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60"
+dependencies = [
+ "form_urlencoded",
+ "idna",
+ "percent-encoding",
+]
+
+[[package]]
+name = "utf-8"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
+
+[[package]]
+name = "utf8_iter"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
+
+[[package]]
+name = "version_check"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
+
+[[package]]
+name = "want"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
+dependencies = [
+ "try-lock",
+]
+
+[[package]]
+name = "warp"
+version = "0.3.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c"
+dependencies = [
+ "bytes",
+ "futures-channel",
+ "futures-util",
+ "headers",
+ "http 0.2.12",
+ "hyper",
+ "log",
+ "mime",
+ "mime_guess",
+ "multer",
+ "percent-encoding",
+ "pin-project",
+ "scoped-tls",
+ "serde",
+ "serde_json",
+ "serde_urlencoded",
+ "tokio",
+ "tokio-tungstenite",
+ "tokio-util",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "wasi"
+version = "0.11.1+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
+
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.59.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
+
+[[package]]
+name = "writeable"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
+
+[[package]]
+name = "yoke"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc"
+dependencies = [
+ "serde",
+ "stable_deref_trait",
+ "yoke-derive",
+ "zerofrom",
+]
+
+[[package]]
+name = "yoke-derive"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+ "synstructure",
+]
+
+[[package]]
+name = "zerocopy"
+version = "0.8.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f"
+dependencies = [
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.8.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "zerofrom"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
+dependencies = [
+ "zerofrom-derive",
+]
+
+[[package]]
+name = "zerofrom-derive"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+ "synstructure",
+]
+
+[[package]]
+name = "zerotrie"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595"
+dependencies = [
+ "displaydoc",
+ "yoke",
+ "zerofrom",
+]
+
+[[package]]
+name = "zerovec"
+version = "0.11.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428"
+dependencies = [
+ "yoke",
+ "zerofrom",
+ "zerovec-derive",
+]
+
+[[package]]
+name = "zerovec-derive"
+version = "0.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]

+ 5 - 2
Cargo.toml

@@ -1,9 +1,12 @@
 [package]
 name = "pageos-core"
-version = "0.1.1"
+version = "0.2.0"
 authors = ["PJ568 <[email protected]>"]
 edition = "2024"
-description = "Core framework for building browser-centric Linux distributions"
+description = "构建以浏览器为核心的 Linux 发行版的核心框架"
 license = "MPL-2.0"
 
 [dependencies]
+warp = "0.3"
+tokio = { version = "1", features = ["full"] }
+home = "0.5"

+ 53 - 0
README.en.md

@@ -0,0 +1,53 @@
+<div align="right" >
+  <details>
+    <summary >🌐 语言</summary>
+    <div>
+      <div align="right">
+        <p><a href="#">English</a></p>
+        <p><a href="README.md">简体中文</a></p>
+      </div>
+    </div>
+  </details>
+</div>
+
+# pageos-core
+
+**Web-Centric OS Framework** · [![MPL-2.0 License](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
+
+> Rust backend with WebSocket bridge + HTML5 UI framework for building  
+> browser-first Linux distributions. Provides secure system API access  
+> and GPU-accelerated Wayland app streaming.
+
+## Core Architecture
+
+- **Display Layer**: Cage + Firefox kiosk mode for single-page app rendering
+- **Service Layer**: Rust WebSocket server
+- **App Ecosystem**: Local/online web application repositories
+- **System Integration**: System calls and hardware access via WebSocket
+
+## Key Features
+
+- 🖥️ Web application repository management (local/online)
+- 🔒 Fine-grained permission control system
+- 🔌 System call APIs (reboot, command execution, etc.)
+- 🚀 GPU-accelerated Wayland application streaming
+- 📦 Unified application package format (metadata.json)
+
+## Repository Components
+
+- [pageos-core](https://github.com/swaybien/pageos-core): Core service (current repo)
+- [pageos-greet](https://github.com/swaybien/pageos-greet): Login manager
+- [pageos-apps](https://github.com/swaybien/pageos-apps): Official web app repository
+- [pageos-pkgr](https://github.com/swaybien/pageos-pkgr): Repository manager
+- [pageos-pkgr-ui](https://github.com/swaybien/pageos-pkgr-ui): Repository manager GUI
+
+## Quick Start
+
+```bash
+# Start core service
+pageos-core -p 12800 --command "cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12800"
+```
+
+## Documentation
+
+See [docs/](docs/) directory

+ 49 - 4
README.md

@@ -1,7 +1,52 @@
+<div align="right" >
+  <details>
+    <summary >🌐 语言</summary>
+    <div>
+      <div align="right">
+        <p><a href="README.en.md">English</a></p>
+        <p><a href="#">简体中文</a></p>
+      </div>
+    </div>
+  </details>
+</div>
+
 # pageos-core
 
-**Web-Centric OS Framework** · [![MPL-2.0 License](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
+**Web-Centric OS 框架** · [![MPL-2.0 License](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
+
+> 基于 Rust 的后端服务 + HTML5 前端框架,用于构建以浏览器为核心的 Linux 发行版。
+> 提供安全的系统 API 访问和 GPU 加速的 Wayland 应用流式传输。
+
+## 核心架构
+
+- **显示层**:Cage + Firefox kiosk 模式渲染单页应用
+- **服务层**:Rust 实现的 WebSocket 服务端
+- **应用生态**:本地/在线网页应用仓库系统
+- **系统集成**:通过 WebSocket 实现系统调用和硬件访问
+
+## 主要功能
+
+- 🖥️ 网页应用仓库管理(本地/在线)
+- 🔒 细粒度权限控制系统
+- 🔌 系统调用 API(重启、命令执行等)
+- 🚀 GPU 加速的 Wayland 应用流式传输
+- 📦 统一的应用包格式(metadata.json)
+
+## 仓库组件
+
+- [pageos-core](https://github.com/swaybien/pageos-core):核心服务(当前仓库)
+- [pageos-greet](https://github.com/swaybien/pageos-greet):登录管理器
+- [pageos-apps](https://github.com/swaybien/pageos-apps):官方网页应用仓库
+- [pageos-pkgr](https://github.com/swaybien/pageos-pkgr):仓库管理工具
+- [pageos-pkgr-ui](https://github.com/swaybien/pageos-pkgr-ui):仓库管理 GUI
+
+## 快速开始
+
+```bash
+# 启动核心服务
+pageos-core -p 12800 --command "cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12800"
+```
+
+## 开发文档
 
-> Rust backend with WebSocket bridge + HTML5 UI framework for building  
-> browser-first Linux distributions. Provides secure system API access  
-> and GPU-accelerated Wayland app streaming.
+详见 [docs/](docs/) 目录

+ 44 - 34
doc/draft.md → docs/draft.md

@@ -12,28 +12,34 @@
   > 还打算做 Rust 双向服务端程序使用 WebSocket 双向通信使这个 HTML 页面能和系统交互。比如 localhost:<服务端端口>/reboot 接口能重启系统等。
   >
   > 我思考一些问题:
-  > 1. 怎么在这样的页面中和 Wayland 下的图形 Linux 程序交互?终端模拟器的实现可以使用 ttyd 创建网页命令行页面,在 HTML 用户界面里打开内容是指向 ttyd 页面的 iframe 的窗口,但其它传统 Wayland 软件怎么办?用 cage 启动应用加 wayvnc 再套 noVNC 吗?还是在双向服务端实现 Wayland2HTML 合成器接口之类的?最好是支持服 GPU 渲染的方案,这样玩游戏,播视频就不卡。
+  >
+  > 1. 怎么在这样的页面中和 Wayland 下的图形 Linux 程序交互?
+  >    终端模拟器的实现可以使用 ttyd 创建网页命令行页面,在 HTML 用户界面里打开内容是指向 ttyd 页面的 iframe 的窗口,但其它传统 Wayland 软件怎么办?
+  >    用 cage 启动应用加 wayvnc 再套 noVNC 吗?还是在双向服务端实现 Wayland2HTML 合成器接口之类的?最好是支持服 GPU 渲染的方案,这样玩游戏,播视频就不卡。
   > 2. 浏览器的实现:我如何在操作页面上访问非同源的网页?似乎不是所有的网页支持在 iframe 中跨域显示。
-  > 3. 打算给这个操作系统打造网页应用生态,应该给这个系统设计一套“网页应用仓库”服务。每个网页应用程序主要包含两个部分:网页(index.html、CSS、JS 和其它资源等)、应用元信息(应用名称、`用户名/仓库名`组成的包名、版本、权限信息等)(可选择以文件形式存在,如 `metadata.json`,或内嵌在 `index.html` 中)。网页应用仓库分为本地和在线,当用户访问一个本地应用(如“设置管理器”)时,实际上是在用内嵌浏览器访问本地仓库中的网页(如 `http://localhost:<服务端端口>/software/pageos/settings-manager/index.html`);当用户访问一个在线应用时,实际是访问官方(或镜像)在线软件源里的网页。用户可以选择将在线软件源里的应用下载到本地以实现“安装”。
+  > 3. 打算给这个操作系统打造网页应用生态,应该给这个系统设计一套“网页应用仓库”服务。
+  >    每个网页应用程序主要包含两个部分:网页(index.html、CSS、JS 和其它资源等)、应用元信息(应用名称、`用户名/仓库名`组成的包名、版本、权限信息等)(可选择以文件形式存在,如 `metadata.json`,或内嵌在 `index.html` 中)。
+  >    网页应用仓库分为本地和在线,当用户访问一个本地应用(如“设置管理器”)时,实际上是在用内嵌浏览器访问本地仓库中的网页(如 `http://127.0.0.1:<服务端端口>/software/pageos/settings-manager/index.html`);当用户访问一个在线应用时,实际是访问官方(或镜像)在线软件源里的网页。用户可以选择将在线软件源里的应用下载到本地以实现“安装”。
+
 - DeepSeek-R1-0528:
 
   > 有创意!针对提出的技术问题的详细分析和建议方案:
   >
   > ### 🧩 技术问题解决方案
   >
-  > #### 1. Wayland应用集成方案
+  > #### 1. Wayland 应用集成方案
   >
-  > - **推荐方案**: WayVNC + noVNC + GPU加速
-  >   - 架构: Cage → Wayland应用 → wayvnc (硬件编码) → noVNC (WebGL解码)
-  >   - GPU加速路径:
-  >     - 应用渲染(GPU) → wayvnc编码(VA-API/NVENC) → noVNC解码(WebGL)
-  >   - 多窗口管理: 每个应用窗口独立wayvnc实例
-  > - 备选方案: XWayland转发(性能较差)
-  > - 高级方案: 自定义Wayland合成器接口(研究性质)
+  > - **推荐方案**: WayVNC + noVNC + GPU 加速
+  >   - 架构: Cage → Wayland 应用 → wayvnc (硬件编码) → noVNC (WebGL 解码)
+  >   - GPU 加速路径:
+  >     - 应用渲染(GPU) → wayvnc 编码(VA-API/NVENC) → noVNC 解码(WebGL)
+  >   - 多窗口管理: 每个应用窗口独立 wayvnc 实例
+  > - 备选方案: XWayland 转发(性能较差)
+  > - 高级方案: 自定义 Wayland 合成器接口(研究性质)
   >
   > #### 2. 浏览器跨域访问
   >
-  > - **解决方案**: Rust反向代理服务
+  > - **解决方案**: Rust 反向代理服务
   >   - 访问模式: `http://localhost:<port>/proxy?url=<encoded_target_url>`
   >   - 安全措施: 内容重写(CSP/HSTS)、请求过滤
   >
@@ -41,7 +47,7 @@
   >
   > - **仓库结构**:
   >   - 本地仓库: `~/.local/share/pageos/software/<user>/<repo>/<version>`
-  >   - 在线仓库: HTTPS访问
+  >   - 在线仓库: HTTPS 访问
   > - **应用包格式**:
   >
   >   ```json
@@ -62,39 +68,39 @@
   >
   > #### 4. 核心挑战解决方案
   >
-  > - **应用认证**: URL令牌注入(`app_id`+安全令牌)
+  > - **应用认证**: URL 令牌注入(`app_id`+安全令牌)
   > - **安全加固**:
   >   - 应用包签名(ECDSA/RSA)
-  >   - 强制HTTPS/WSS
-  >   - 严格CSP策略
-  >   - iframe沙盒属性
+  >   - 强制 HTTPS/WSS
+  >   - 严格 CSP 策略
+  >   - iframe 沙盒属性
   > - **数据存储**:
   >   - 简单数据: localStorage
-  >   - 重要数据: Rust服务端API(`/fs/read`, `/fs/write`)
+  >   - 重要数据: Rust 服务端 API(`/fs/read`, `/fs/write`)
   >
   > #### 5. 实施路线图
   >
   > 1. 定义`metadata.json`规范
   > 2. 实现核心仓库服务(安装/更新/权限)
-  > 3. 解决应用认证问题(URL令牌)
+  > 3. 解决应用认证问题(URL 令牌)
   > 4. 开发基础应用启动器
 
 ## 方案
 
 ### 仓库
 
-#### swaybien/pageos-greet
+#### swaybien/pageos-greet(已完成)
 
 Rust 语言编写的登录界面服务器。包含一个最小网页服务器和内置的登录页面。
 
-以下是初帮助参数外可用参数:
+以下是除帮助参数外可用参数:
 
 ```bash
 pageos-greet \
-  --port 12800 \
+  --port 12801 \
   --page /path/to/login.html \
-  --launch-command "cage -s -- firefox --kiosk --no-remote http://localhost:12800/login" \
-  --session-command "pageos-core -p 12800 --command \"cage -s -- firefox --kiosk --no-remote http://localhost:12800\""
+  --launch-command "cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12801" \
+  --session-command "pageos-core -p 12800 --command \"cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12800\""
 ```
 
 - 登录界面:
@@ -102,29 +108,33 @@ pageos-greet \
   - 默认的 HTML 登录页面内置在主程序 `pageos-greet` 中;
   - 如果需要自定义登录界面,则使用参数传入自定义 HTML;
 
-#### swaybien/pageos-core
+#### swaybien/pageos-core(当前目标)
 
 Rust 语言编写的 Web-Centric OS Framework(双向服务端程序)。
 
+- 网页服务器(已完成):只是在将 `$HOME/.local/share/pageos/` 下的文件(如 index.html )读取并显示。
 - 网页应用仓库:
-  - 本地应用仓库:`$HOME/.local/share/pageos/software`
-  - 在线应用仓库:`https://<domain>/software`
+  - 本地网页应用仓库:`$HOME/.local/share/pageos/software`
+  - 在线网页应用仓库:`https://<domain>/software`
 - 用户界面:
-  - 启动用户界面的命令:`pageos-core -p 12800 --command "cage -s -- firefox --kiosk --no-remote http://localhost:12800"`;
+  - 启动用户界面的命令:`pageos-core -p 12800 --command "cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12800"`;
   - 默认的 HTML 用户界面内置在主程序 `pageos-core` 中;
   - 如果需要自定义用户界面,则将自定义 HTML 写入 `$HOME/.local/share/pageos/index.html`,`pageos-core` 会自动读取并优先使用这个文件;
+- 存储:
+  - 在统一的 websocket 接口实现连接后可用类似 localstorage 的方法存取数据到本地文件;
+  - 在统一的 websocket 接口实现连接后可用类似 indexdb 的方法存取数据到本地文件;
+- 对接 polkit:
+  - 当需要授权时,通知网页,并接受网页传回的验证信息;
+- 系统调用 Linux 命令交互:
+  - 在统一的 websocket 接口实现执行命令并实时返回结果(以给 JS 处理);
 
 #### swaybien/pageos-apps
 
-官方的网页应用仓库。
-
-#### swaybien/pageos-arch-template
-
-用 archiso 创建的基于 Arch Linux 的预装 pageos-core 的镜像的模板。
+官方的网页应用仓库。托管登陆页面、用户界面和依赖的软件包。
 
-#### swaybien/pageos
+#### swaybien/pageos(已完成)
 
-基于 pageos-arch-template 的 PageOS 镜像维护仓库。主要维护登陆页面、用户界面和依赖的软件包。
+基于 Arch Linux 的 PageOS 镜像维护仓库。
 
 #### swaybien/pageos-pkgr
 

+ 51 - 0
docs/prompt.md

@@ -0,0 +1,51 @@
+# 提示词
+
+## 核心
+
+(注:有些文件的父目录在符号链接中,所以在列表中不可见,请正常访问读取)
+
+我们这一次只做以下的事:
+
+1. **一次性直接读取以下文件:**
+   `docs/draft.md`;
+2. 和我讨论如何实现网页服务器和内嵌的 Web 页面,目前我的一些想法:
+
+   - 网页服务器只是在将 `$HOME/.local/share/pageos/` 下的文件(如 index.html )读取并显示。
+
+3. 在 `src/server.rs` 实现网页服务器。
+4. 在 `src/main.rs` 实现调用。
+
+## 界面
+
+(注:有些文件的父目录在符号链接中,所以在列表中不可见,请正常访问)
+
+我们接下来会在 `index.html` 纯 HTML 单文件实现:
+
+- 进程:
+  - 进程可以运行 JS 命令,进程可以拥有零个或多个子进程;
+  - 进程可以有零个或多个设置项,用来供设置管理器统一显示给用户用来更改该进程的设置;
+  - 进程可以拥有零个或多个窗口;进程间通信;
+- 窗口:
+  - 窗口可以被拖动、调整大小、最小化、最大化、关闭;
+  - 窗口可以为:边框、无边框、全屏;无边框和全屏都只显示当前标签页;
+  - 窗口可以拥有一个或多个标签页;
+    - 有多个标签页时可在标签页列表点击切换、关闭;
+    - 每个标签页可带一段 CSS;
+- 程序起动器:
+  - 打开一个窗口,里面列着应用程序,可点击启动应用程序;
+- 桌面背景:
+  - 桌面背景由进程和全屏窗口组成;
+- 任务栏:
+  - 任务栏由进程和无边框窗口组成,显示在底部;
+  - 任务栏左侧是程序启动器;
+  - 任务栏中部是已启动的进程(应用程序);
+    - 窗口列表(已启动的有窗口的进程);
+    - 后台列表(已启动的没有窗口的进程(后台程序),如后台运行的音乐播放器);
+  - 任务栏右侧是状态信息(网络、蓝牙、电量和电池状态、日期时间);
+
+外观设计语言:扁平化,方角,强调色描边、柔和色填充,无阴影,少过度动画。焦点选中处强调色更亮。
+
+目前暂不考虑和 Rust 后端的对接等。只需实现以上功能的 HTML。接下来只需要完成一个模块:进程:
+
+1. 分析进程设计;
+2. 逐步在 `./index.html` 中实现进程功能;

+ 6 - 2
src/main.rs

@@ -2,6 +2,10 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
 
-fn main() {
-    println!("Hello, world!");
+mod server;
+
+#[tokio::main]
+async fn main() {
+    // 启动网页服务器,端口12800
+    server::start_server(12800).await;
 }

+ 3 - 0
src/mod/terminal-emulator.rs

@@ -0,0 +1,3 @@
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at https://mozilla.org/MPL/2.0/.

+ 38 - 0
src/server.rs

@@ -0,0 +1,38 @@
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at https://mozilla.org/MPL/2.0/.
+
+use std::path::PathBuf;
+use warp::Filter;
+
+/// 启动网页服务器
+///
+/// # 参数
+/// - port: 服务器监听端口
+pub async fn start_server(port: u16) {
+    // 获取用户主目录
+    let home_dir = match home::home_dir() {
+        Some(path) => path,
+        None => {
+            eprintln!("无法获取用户主目录");
+            return;
+        }
+    };
+
+    // 构建静态文件目录路径
+    let static_dir = home_dir.join(".local/share/pageos");
+
+    // 创建静态文件路由
+    let static_files = warp::get()
+        .and(warp::fs::dir(static_dir))
+        .with(warp::log("pageos::server"));
+
+    // 设置服务器地址
+    let addr = ([127, 0, 0, 1], port);
+
+    let (a, b, c, d) = (addr.0[0], addr.0[1], addr.0[2], addr.0[3]);
+    println!("启动服务器: http://{}.{}.{}.{}:{}", a, b, c, d, addr.1);
+
+    // 启动服务器
+    warp::serve(static_files).run(addr).await;
+}