build: adopt esbuild for frontend bundling (build:web → public/build/)
- esbuild dev dep; build:web/dev:web bundle public/main.ts → public/build/main.js - gitignore public/build/; tsconfig.web.json now typecheck-only - frontend build convention documented in PLAN §1, DISPATCH, ARCHITECTURE §5 - resolves the T1 deferred decision
This commit is contained in:
@@ -129,8 +129,9 @@ Accept:vitest run origin 全绿。歧义则 [!] BLOCKED;不写 LOG;结尾给日
|
||||
### T8 — index.html · `Agent(module-builder, model:"haiku", isolation:"worktree")`
|
||||
```
|
||||
执行 PLAN 任务 T8(public/index.html)。先读 PLAN 任务 T8、ARCHITECTURE §5。
|
||||
硬边界 —— 只创建:public/index.html。要点:终端容器 #term、键栏挂载点 #keybar、引 main.ts/style.css、
|
||||
移动端 viewport meta。Accept:浏览器打开无控制台报错。歧义则 [!] BLOCKED;不写 LOG;结尾给日志条目。
|
||||
硬边界 —— 只创建:public/index.html。要点:终端容器 #term、键栏挂载点 #keybar、移动端 viewport meta;
|
||||
**按 PLAN §1 前端构建约定**用 `<script type="module" src="./build/main.js">` 加载(及 `<link>` 引 ./build/main.css 与 style.css)。
|
||||
Accept:浏览器打开无控制台报错。歧义则 [!] BLOCKED;不写 LOG;结尾给日志条目。
|
||||
```
|
||||
|
||||
### T9 — style.css · `Agent(module-builder, model:"haiku", isolation:"worktree")`
|
||||
@@ -152,8 +153,8 @@ Accept:vitest run keybar 全绿。歧义则 [!] BLOCKED;不写 LOG;结尾给日
|
||||
### T11 — main.ts · `Agent(module-builder, model:"sonnet", isolation:"worktree")`
|
||||
```
|
||||
执行 PLAN 任务 T11(public/main.ts)。先读 PLAN 任务 T11、ARCHITECTURE §5/§6,搜 "M6" 照做;背景 TECH_DOC §6/§9。
|
||||
依赖 src/types.ts 的 mountKeybar 签名(仅签名,可并行)。硬边界 —— 只创建:public/main.ts。
|
||||
要点:xterm + FitAddon,fit() 必须在容器有真实尺寸后调用(display:none 得 NaN);
|
||||
依赖 src/types.ts 的 mountKeybar 签名(仅签名,可并行)。硬边界 —— 只创建:public/main.ts。本文件是 **esbuild 打包入口**(PLAN §1 约定)。
|
||||
要点:xterm + FitAddon + `import '@xterm/xterm/css/xterm.css'`,fit() 必须在容器有真实尺寸后调用(display:none 得 NaN);
|
||||
**WS scheme 随页面协议 https→wss(M6)**,URL …/term,首帧发 attach(localStorage 取 sessionId);
|
||||
term.onData→ws.send {input};onmessage 按 type 处理(attached 存 id、output→term.write、exit→提示重连);
|
||||
ResizeObserver→fit→发 resize(防抖 100ms);断线指数退避重连 1/2/4…≤30s 携带 sessionId;mountKeybar(d=>ws.send)。
|
||||
@@ -194,7 +195,7 @@ Accept:vitest run manager 全绿。歧义则 [!] BLOCKED;不写 LOG;结尾给日
|
||||
```
|
||||
执行 PLAN 任务 T14(server.ts)。先读 PLAN 任务 T14、ARCHITECTURE §3.6,逐条搜 "M4" "M5" "L3" "L5" 照做;
|
||||
用 config/protocol/origin/manager。硬边界 —— 只创建:src/server.ts。
|
||||
要点:Express 托管 public/;**WebSocketServer({noServer:true})**;HTTP upgrade:非 /term→destroy、Origin 不过→
|
||||
要点:Express 静态托管 public/(含 esbuild 产物 public/build/);**WebSocketServer({noServer:true})**;HTTP upgrade:非 /term→destroy、Origin 不过→
|
||||
socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n')+destroy、通过→handleUpgrade→emit connection(L3);
|
||||
connection 等首帧 attach→try handleAttach 回 attached,**catch→send exit(-1,reason)+close 仅此连接,不 fail-fast(M4)**;
|
||||
message:parse,ok:false 丢弃记日志,否则路由 writeInput/resize;close→detach;SIGINT/SIGTERM→shutdown;
|
||||
|
||||
Reference in New Issue
Block a user