override spike-first(创始人 06-23 裁),全栈铺 Phaser tier2 引擎。recon→契约→6模块并行→集成 workflow 产出 ~60 文件,全 6c6g 静态校验过、红线零碰 Tier0/1 产线: - 契约(6):tier2-source-project.schema / tier2-verdict.schema(fork·round放开·三层校验+富游戏门)/ toolkit 签名 / 探针钩子 / boot-phaser-host.d.ts / mini-肥鹅 fixture 规格 - M1 Phaser scaffold+装载 host+引擎能力面(19;logic-smoke 13/13:五耦合点真接线+赢输双路径+latch不回弹) - M2 CDP 探针 Phaser 重写+business-sim driver+九门+富游戏三门(5;verdict 过 schema) - M3 Python 单写 ReAct agent loop+9 工具 toolkit+M3 Anthropic接法+四熔断(9;mini-desktop 真 2.0.2 venv 验:import/9工具/中间件注册 OK) - M4 datatable schema+金标+资产占位(4)/ M5 prompt+Phaser skill+rag(13)/ M6 成本 RecordingChatModel+trace adapter(3) - 集成:run_engine.py 入口 + 接线断点已修 + RUN-ON-MINI-DESKTOP.md 待 mini-desktop 真跑(esbuild build + CDP 九门 + M3 生成 = 本质即 0号 spike)。AgentScope 2.0.2 API 逐条对 /root/oss/agentscope 源码核验。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
80 lines
4.1 KiB
HTML
80 lines
4.1 KiB
HTML
<!doctype html>
|
||
<!--
|
||
index.html —— mini-肥鹅 宿主页面(mini-desktop 真跑 / CDP harness 入口 · 平台预建)
|
||
owner:tier2 引擎线(M1)
|
||
|
||
【这份是什么】
|
||
第二装载分支 host(boot-phaser-host.js)需要一个宿主页面:预载 Phaser(经 opts.engine 注入边界)、
|
||
引入构建产物 bundle.iife.js(esbuild 打出的 __Tier2GameBundle),再调 bootPhaserHost 把游戏跑起来。
|
||
harness(U3 CDP 探针)navigate 到本页 → 轮询 window.__tier2Booted(A6 boot 信号)→ 驱动 + 读 window.__gameState。
|
||
|
||
【运行环境】
|
||
6c6g 禁 chrome → 本页只在 mini-desktop 真跑。本机仅静态校验(node --check / 逻辑冒烟)。
|
||
构建产物 bundle.iife.js 由 tier2/engine/build-phaser.mjs 在 mini-desktop esbuild 打出(external:phaser)。
|
||
|
||
【Phaser 注入边界(Q4 铁律)】
|
||
boot-phaser-host.js 不顶层 import 'phaser';Phaser 由本页 <script> 预载为全局 window.Phaser,
|
||
boot 时经 opts.engine 注入。bundle 也 external 'phaser'(不重复打包,运行时绑全局)。
|
||
-->
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<title>mini-肥鹅 · tier2 fixture</title>
|
||
<style>
|
||
html, body { margin: 0; padding: 0; background: #1a1a26; height: 100%; }
|
||
#game-parent { width: 390px; height: 844px; margin: 0 auto; }
|
||
#status { color: #aaa; font: 12px/1.5 monospace; padding: 6px 10px; }
|
||
</style>
|
||
<!-- 预载 Phaser(mini-desktop 真跑:可换 CDN 或本地 node_modules/phaser/dist/phaser.min.js)。 -->
|
||
<script src="https://cdn.jsdelivr.net/npm/phaser@3.80.1/dist/phaser.min.js"></script>
|
||
</head>
|
||
<body>
|
||
<div id="status">loading…</div>
|
||
<div id="game-parent"></div>
|
||
|
||
<!-- 构建产物(esbuild iife,挂全局 __Tier2GameBundle)。mini-desktop 先跑 build-phaser.mjs 生成。 -->
|
||
<script src="./bundle.iife.js"></script>
|
||
|
||
<!-- 装载 host:经 type=module 引 boot-phaser-host.js,注入 window.Phaser,取 __Tier2GameBundle 工厂启动。 -->
|
||
<script type="module">
|
||
import { bootPhaserHost } from '../../engine/boot-phaser-host.js';
|
||
|
||
const statusEl = document.getElementById('status');
|
||
// 取构建产物里的工厂(main.js 默认导出 / createGame 具名导出)。
|
||
const bundle = window.__Tier2GameBundle || {};
|
||
const factory = bundle.default || bundle.createGame;
|
||
if (typeof factory !== 'function') {
|
||
statusEl.textContent = 'ERROR: 未找到 __Tier2GameBundle 工厂(先在 mini-desktop 跑 build-phaser.mjs)';
|
||
throw new Error('missing factory');
|
||
}
|
||
|
||
// seed 可由 harness 经 URL ?seed= 注入(确定性重放)。
|
||
const seed = (new URLSearchParams(location.search).get('seed') | 0) || 12345;
|
||
|
||
bootPhaserHost({
|
||
parent: document.getElementById('game-parent'),
|
||
engine: window.Phaser, // Q4 注入边界:Phaser 全局注入
|
||
factory, // 构建产物工厂
|
||
seed,
|
||
viewport: { w: 390, h: 844 },
|
||
assets: {}, // spike 期空(render 走类目色占位)
|
||
// F 门真接线取证:引擎能力 call-ID 记进全局(harness 据 window.__engineCalls 证真调引擎)。
|
||
recHook: (id) => { (window.__engineCalls = window.__engineCalls || []).push(id); },
|
||
// 就绪钩子:挂取证全局(A6:__gameState 读语义 state,__tier2Host 拿驱动面,__tier2Frame 帧源)。
|
||
onReady: (host, internals) => {
|
||
window.__tier2Host = host;
|
||
window.__gameState = () => host.state(); // A6 语义 state 只读
|
||
window.__tier2LatchInfo = () => host.latchInfo(); // latch 门读它
|
||
window.__tier2Frame = () => host.engineFrame(); // A6 帧源(探针 frameReadExpr 候选)
|
||
// B 门读 window.__tier2Internals.uncaught[](直接引用 host 内部 uncaught 数组)。
|
||
window.__tier2Internals = { uncaught: (internals && internals.uncaught) || [] };
|
||
statusEl.textContent = 'booted · seed=' + seed;
|
||
},
|
||
}).catch((e) => {
|
||
statusEl.textContent = 'BOOT FAILED: ' + (e && e.message);
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|