@kenhkl/agent-moss 0.8.5 → 0.9.0
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/dist/cli.js +28 -13
- package/dist/cli.js.map +1 -1
- package/dist/engine/coordinator.d.ts +52 -0
- package/dist/engine/coordinator.js +3483 -0
- package/dist/engine/coordinator.js.map +1 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.js +4721 -0
- package/dist/server.js.map +1 -0
- package/package.json +13 -2
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
|
|
3
|
+
declare function createApp(): Hono;
|
|
4
|
+
/**
|
|
5
|
+
* 从 startPort 开始找第一个可用端口(照搬 OpenDesk findFreePort 策略)。
|
|
6
|
+
* 用 net.createServer().listen 试端口,成功立刻 close 返回该端口;全占 fallback
|
|
7
|
+
* 到 startPort(让 hono 自己报错,不静默换到离谱端口)。
|
|
8
|
+
*
|
|
9
|
+
* 为什么需要:默认 9090 被占时服务起不来、xiaoO 全 fail-closed。预探测找空闲端口,
|
|
10
|
+
* 配合消费方探测兜底(bridge.ts probeAgentMossUrl),保证服务总能起、消费方能连上。
|
|
11
|
+
*/
|
|
12
|
+
declare function findFreePort(startPort: number, host?: string, scan?: number): Promise<number>;
|
|
13
|
+
declare function startServer(host?: string, port?: number): Promise<{
|
|
14
|
+
serve: () => Promise<void>;
|
|
15
|
+
port: number;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
export { createApp, findFreePort, startServer };
|