diff --git a/pyproject.toml b/pyproject.toml index ca3cd9c..83227f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=45", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "runtime" +name = "scense_runtime" version = "1.0.0" description = "元景 W-10 运行时执行引擎(前端 JS 引擎 + 可选服务端辅助)" requires-python = ">=3.8" @@ -11,4 +11,4 @@ dependencies = ["sqlor", "bricks_for_python"] [tool.setuptools.packages.find] where = ["."] -include = ["runtime*"] +include = ["scense_runtime*"] diff --git a/runtime/__init__.py b/scense_runtime/__init__.py similarity index 100% rename from runtime/__init__.py rename to scense_runtime/__init__.py diff --git a/runtime/init.py b/scense_runtime/init.py similarity index 96% rename from runtime/init.py rename to scense_runtime/init.py index 8d046a3..751f501 100644 --- a/runtime/init.py +++ b/scense_runtime/init.py @@ -14,7 +14,7 @@ from .runtime_service import ( ) -async def load_runtime(env): +def load_runtime(env): """挂载 runtime 模块到 ServerEnv(宿主应用 app/scense.py 在 init() 中调用)。 参数 env: ahserver.ServerEnv 单例。 diff --git a/runtime/runtime_service.py b/scense_runtime/runtime_service.py similarity index 100% rename from runtime/runtime_service.py rename to scense_runtime/runtime_service.py diff --git a/scripts/load_path.py b/scripts/load_path.py index a1f2305..6fdbf54 100644 --- a/scripts/load_path.py +++ b/scripts/load_path.py @@ -3,7 +3,7 @@ """runtime 模块 RBAC 路径注册脚本(scripts/load_path.py)。 模块目录结构硬性要求(review-develop 第一章):每个业务模块必须携带本脚本。 -本脚本将 /runtime/play.html、/runtime/api/*.dspy、index.ui 等全部新路径注册到 +本脚本将 /scense_runtime/play.html、/scense_runtime/api/*.dspy、index.ui 等全部新路径注册到 宿主 RBAC(角色分层:any=静态资源免登录;logined=登录即可), 并同步提示写入中央 load_path.py(双入口,防 per-module 脚本静默失败)。 @@ -13,23 +13,23 @@ import os import subprocess import sys -MOD = 'runtime' +MOD = 'scense_runtime' # ---- 角色分层路径清单(新增页面/API 必须同步维护此处) ---- # any:免登录静态资源(JS/CSS;页面内由 ahserver 自动服务) PATHS_ANY = [ - '/runtime/runtime.js', + '/scense_runtime/runtime.js', ] # logined:登录即可访问的页面与 API PATHS_LOGINED = [ - '/runtime', - '/runtime/index.ui', - '/runtime/play.html', - '/runtime/api/load_world.dspy', - '/runtime/api/runtime_status.dspy', - '/runtime/api/runtime_event.dspy', - '/runtime/api/runtime_control.dspy', + '/scense_runtime', + '/scense_runtime/index.ui', + '/scense_runtime/play.html', + '/scense_runtime/api/load_world.dspy', + '/scense_runtime/api/runtime_status.dspy', + '/scense_runtime/api/runtime_event.dspy', + '/scense_runtime/api/runtime_control.dspy', ] CENTRAL_HINT = ( diff --git a/wwwroot/index.ui b/wwwroot/index.ui index e51227f..f2d0b35 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -46,7 +46,7 @@ "actiontype": "urlwidget", "target": "app.runtime_content", "options": { - "url": "{{entire_url('/runtime/play.html')}}" + "url": "{{entire_url('/scense_runtime/play.html')}}" }, "mode": "replace" } @@ -85,7 +85,7 @@ "actiontype": "urlwidget", "target": "app.runtime_content", "options": { - "url": "{{entire_url('/runtime/api/runtime_status.dspy?runtime_id=local')}}" + "url": "{{entire_url('/scense_runtime/api/runtime_status.dspy?runtime_id=local')}}" }, "mode": "replace" } diff --git a/wwwroot/play.html b/wwwroot/play.html index 6e048cf..b1af9a7 100644 --- a/wwwroot/play.html +++ b/wwwroot/play.html @@ -153,7 +153,7 @@ // 控件 btnStart.onclick = function () { // 尝试服务端辅助初始化;失败自动降级独立模式(W-10i) - fetch('/runtime/api/load_world.dspy?world_id=w10_demo', { method: 'GET' }) + fetch('/scense_runtime/api/load_world.dspy?world_id=w10_demo', { method: 'GET' }) .then(function (r) { return r.json(); }) .then(function (data) { rt.initWorld(data); diff --git a/wwwroot/runtime.js b/wwwroot/runtime.js index ac09907..fda3622 100644 --- a/wwwroot/runtime.js +++ b/wwwroot/runtime.js @@ -17,7 +17,7 @@ * * 用法: * var rt = new RuntimeEngine({ worldId: 'w1', canvas: canvasEl }); - * rt.initWorld(serverData); // serverData 可来自 /runtime/api/load_world.dspy + * rt.initWorld(serverData); // serverData 可来自 /scense_runtime/api/load_world.dspy * rt.start(); * rt.on('log', function(m){ ... }); // UI 订阅日志 */ diff --git a/wwwroot/runtime/api/load_world.dspy b/wwwroot/runtime/api/load_world.dspy deleted file mode 100644 index 55f9429..0000000 --- a/wwwroot/runtime/api/load_world.dspy +++ /dev/null @@ -1 +0,0 @@ -调用 load_runtime_world 组装运行时数据 \ No newline at end of file diff --git a/wwwroot/runtime/api/runtime_status.dspy b/wwwroot/runtime/api/runtime_status.dspy deleted file mode 100644 index a4e0d53..0000000 --- a/wwwroot/runtime/api/runtime_status.dspy +++ /dev/null @@ -1 +0,0 @@ -调用 runtime_status 健康检查 \ No newline at end of file diff --git a/wwwroot/runtime/engine.js b/wwwroot/runtime/engine.js deleted file mode 100644 index 5230169..0000000 --- a/wwwroot/runtime/engine.js +++ /dev/null @@ -1 +0,0 @@ -见交付正文 engine.js(RuntimeEngine/EntityRuntime 完整实现,9 能力) \ No newline at end of file diff --git a/wwwroot/runtime/index.ui b/wwwroot/runtime/index.ui deleted file mode 100644 index ab8c44c..0000000 --- a/wwwroot/runtime/index.ui +++ /dev/null @@ -1 +0,0 @@ -模块入口页(Iframe 集成 play.html) \ No newline at end of file diff --git a/wwwroot/runtime/play.html b/wwwroot/runtime/play.html deleted file mode 100644 index 20cfb96..0000000 --- a/wwwroot/runtime/play.html +++ /dev/null @@ -1 +0,0 @@ -沙盒页:画布渲染实体树 + 控制面板(初始化/加载/开始/暂停/恢复/停止)+ 事件日志 + 错误日志 + 统计,点击实体派发 click 事件 \ No newline at end of file