初始化询价智能体新仓:同步本地工程并排除密钥与 .env。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# AIBOT 桥
|
||||
|
||||
仅传输、无业务状态。测试默认端口 `8913`、绑定 `127.0.0.1`。
|
||||
|
||||
```text
|
||||
node server.cjs
|
||||
curl http://127.0.0.1:8913/health
|
||||
```
|
||||
|
||||
并存期请保持 `WECOM_AIBOT_ENABLED=false`,不要与现网 8813 同时连同一 Bot。
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "ytd-aibot-bridge",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "企微 AIBOT 本机回环桥(传输-only,骨架默认不连 Bot)",
|
||||
"main": "server.cjs",
|
||||
"scripts": {
|
||||
"start": "node server.cjs"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* AIBOT 长连接桥(骨架)
|
||||
*
|
||||
* 本文件职责:仅做本机回环 HTTP 健康检查与转发壳;不拥有业务状态。
|
||||
* 端口:环境变量 AIBOT_BRIDGE_PORT(测试默认 8913),绑定 AIBOT_BRIDGE_BIND(默认 127.0.0.1)。
|
||||
* 禁止:并存期连接现网 Bot 长连接(现网 8813 已占用);禁止在本进程写工单/六态/Graph。
|
||||
* 启动:在 aibot-bridge 目录执行 node server.cjs
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const http = require("http");
|
||||
|
||||
const port = Number(process.env.AIBOT_BRIDGE_PORT || 8913);
|
||||
const bind = process.env.AIBOT_BRIDGE_BIND || "127.0.0.1";
|
||||
const enabled = String(process.env.WECOM_AIBOT_ENABLED || "false").toLowerCase() === "true";
|
||||
|
||||
const server = http.createServer((req, res) => {
|
||||
// 只处理短请求;真实 AIBOT 帧转发后续迭代。请求线程不做业务。
|
||||
if (req.url === "/health" || req.url === "/health/") {
|
||||
const body = JSON.stringify({
|
||||
status: "UP",
|
||||
service: "aibot-bridge",
|
||||
bind,
|
||||
port,
|
||||
wecomAibotEnabled: enabled,
|
||||
note: enabled
|
||||
? "enabled flag on — 仍须确认未与现网双连"
|
||||
: "scaffold: Bot 长连接默认关闭(并存期禁止再连)",
|
||||
});
|
||||
res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" });
|
||||
res.end(body);
|
||||
return;
|
||||
}
|
||||
|
||||
res.writeHead(404, { "Content-Type": "application/json; charset=utf-8" });
|
||||
res.end(JSON.stringify({ error: "not_found", path: req.url }));
|
||||
});
|
||||
|
||||
server.listen(port, bind, () => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(
|
||||
`[aibot-bridge] listening http://${bind}:${port}/health wecomAibotEnabled=${enabled}`
|
||||
);
|
||||
if (enabled) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
"[aibot-bridge] WECOM_AIBOT_ENABLED=true:请确认已停现网桥且不会双连同一 Bot"
|
||||
);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user