feat: establish Hestia server with preserved deployment resources
Verify Hestia server / verify (push) Failing after 0s

This commit is contained in:
2026-10-20 01:10:02 +08:00
commit 85ca0cd124
54 changed files with 3713 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
[package]
name = "admin"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
[[bin]]
name = "cli"
path = "src/main.rs"
[dependencies]
core.workspace = true
host.workspace = true
[lints]
workspace = true
+3
View File
@@ -0,0 +1,3 @@
# 兼容管理程序
Cargo 包名 admin,二进制 cli。仅提供 bootstrap、metadata put/get/import 和 help,保持既有部署脚本兼容。源码位于 [src](src/README.md),Cargo.toml 声明固定 Aster core 和本地 host 依赖。语言执行命令属于独立 Lyra。返回 [crates](../README.md)。
+3
View File
@@ -0,0 +1,3 @@
# 管理命令实现
main.rs 负责对象引导与释放、宿主 JSON 读写和缺失键导入;不提供 run/eval/parse,也不连接数据库。运行验证由 scripts/smoke.py 覆盖。返回 [admin](../README.md)。
+68
View File
@@ -0,0 +1,68 @@
use std::error::Error;
use std::process::ExitCode;
use endor_core::{Value, Vm};
use host::MetadataStore;
const USAGE: &str = "Usage: cli [bootstrap | metadata put <key> <value> | metadata get <key> | metadata import | help]";
fn main() -> ExitCode {
match run() {
Ok(()) => ExitCode::SUCCESS,
Err(error) => {
eprintln!("cli: {error}");
ExitCode::FAILURE
}
}
}
fn run() -> Result<(), Box<dyn Error>> {
let args: Vec<String> = std::env::args().skip(1).collect();
match args
.iter()
.map(String::as_str)
.collect::<Vec<_>>()
.as_slice()
{
[] | ["bootstrap"] => {
let mut vm = Vm::new()?;
let first = vm.new_object()?;
let second = vm.new_object()?;
vm.set_attr(
first,
"message",
Value::Text("Hello from EndorObject".into()),
)?;
println!("runtime=EndorObject type_system=disabled");
println!(
"objects_distinct={} heap_objects={}",
first != second,
vm.object_count()
);
vm.release(first)?;
vm.release(second)?;
println!("released heap_objects={}", vm.object_count());
println!("bootstrap uses no database");
}
["help"] | ["--help"] | ["-h"] => println!("{USAGE}"),
["metadata", "put", key, value] => {
MetadataStore::from_env()?.put(key, value)?;
println!("stored (file)");
}
["metadata", "get", key] => {
println!(
"{}",
MetadataStore::from_env()?
.get(key)?
.as_deref()
.unwrap_or("(missing)")
);
}
["metadata", "import"] => {
let count = MetadataStore::from_env()?.import_missing(std::io::stdin().lock())?;
println!("imported {count} missing entries (file)");
}
_ => return Err(USAGE.into()),
}
Ok(())
}