dsh-connect-workbuddy-gateway 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/discovery.js +16 -0
package/README.md
CHANGED
|
@@ -558,7 +558,7 @@ hy4flash-free@#9 ← 昵称含中文/emoji,退化成序号
|
|
|
558
558
|
node tests/harness.mjs
|
|
559
559
|
```
|
|
560
560
|
|
|
561
|
-
覆盖
|
|
561
|
+
覆盖 343 项:首次建 key 与惰性补选、鉴权、模型勾选与清单投影、重名后缀(区域 / 昵称 /
|
|
562
562
|
非 ASCII 序号)、跨区同名、按名字路由、推理档透传、**固定监听端口与占用提示**、**局域网分享与接入**、**两种角色模式**、
|
|
563
563
|
并行工具调用按 index 分组、
|
|
564
564
|
Responses 流的规范校验(`sequence_number`、part 一致性、terminal 的 output 顺序)、
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-connect-workbuddy-gateway",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "把 dsh-connect-workbuddy 的 WorkBuddy 模型开放成 HTTP API:OpenAI Chat / Responses、Anthropic Messages、Gemini 四协议共用一个固定 base URL,模型按 API key 逐个勾选。也可切换成接收方,接入局域网内另一台设备分享的模型。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh-plugin",
|
package/src/discovery.js
CHANGED
|
@@ -55,6 +55,22 @@ export async function discoverPeers({ port = DEFAULT_DISCOVERY_PORT, timeoutMs =
|
|
|
55
55
|
socket.bind(0, () => resolve())
|
|
56
56
|
})
|
|
57
57
|
|
|
58
|
+
/*
|
|
59
|
+
* **必须显式打开广播权限。**
|
|
60
|
+
*
|
|
61
|
+
* 少了这一句,发往 `255.255.255.255` / `x.x.x.255` 的包会被内核静默丢弃
|
|
62
|
+
* (`EACCES`),但 `send` 的回调不会报错、socket 也不报错 —— 表现为「扫描永远
|
|
63
|
+
* 返回 0 个,而手动填地址一切正常」。
|
|
64
|
+
*
|
|
65
|
+
* 这个坑在 macOS 上必现,在 Windows 上有时能通(对不同广播地址更宽松),所以
|
|
66
|
+
* 只在一台机器上测过的话很容易漏掉。
|
|
67
|
+
*/
|
|
68
|
+
try {
|
|
69
|
+
socket.setBroadcast(true)
|
|
70
|
+
} catch (error) {
|
|
71
|
+
logger?.warn?.(`workbuddy-gateway: could not enable broadcast: ${error instanceof Error ? error.message : String(error)}`)
|
|
72
|
+
}
|
|
73
|
+
|
|
58
74
|
socket.on('message', (buffer, remote) => {
|
|
59
75
|
const reply = parseAnnouncement(buffer)
|
|
60
76
|
if (reply === undefined) return
|