@1agents/dreammate-network 0.3.0 → 0.3.1

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.
@@ -12,7 +12,7 @@
12
12
  * 协议版本,与本包的 package.json 版本保持一致——两个版本号会让人永远猜不准
13
13
  * 该看哪个。服务在 `manifest.metadata.protocol_version` 里报告它遵循的版本。
14
14
  */
15
- export declare const PROTOCOL_VERSION = "0.3.0";
15
+ export declare const PROTOCOL_VERSION = "0.3.1";
16
16
  /** `session://<node>/<runtime>/<session_id>` */
17
17
  export type SessionURI = `session://${string}/${string}/${string}`;
18
18
  /** 资源寻址,如 `recording://tingqi-01/abc`、`speaker://tingqi-001/speaker-23` */
@@ -37,6 +37,11 @@ export type Protocol = "mcp" | "http" | "cli" | "acp";
37
37
  /**
38
38
  * 同一组能力可以同时有多种 access,调用方不必关心底层是谁。
39
39
  * 包装优先级 MCP > CLI > HTTP,但第一版不做自动 fallback 编排,手工声明即可。
40
+ *
41
+ * **数组是有序的:靠前的优先,靠后的是 fallback。** 同一个 protocol 出现多次
42
+ * 是合法且有用的——比如 HTTP 先给 MagicDNS 名(可读、IP 变了也不用改),
43
+ * 再给 tailnet IP 兜底:调用方的 DNS 可能被代理软件劫持(实测一台装了
44
+ * fake-ip 代理的 Mac 会把 MagicDNS 名解析到 198.18.x.x),那时只有 IP 能用。
40
45
  */
41
46
  export interface AccessDescriptor {
42
47
  protocol: Protocol;
@@ -12,7 +12,7 @@
12
12
  * 协议版本,与本包的 package.json 版本保持一致——两个版本号会让人永远猜不准
13
13
  * 该看哪个。服务在 `manifest.metadata.protocol_version` 里报告它遵循的版本。
14
14
  */
15
- export const PROTOCOL_VERSION = "0.3.0";
15
+ export const PROTOCOL_VERSION = "0.3.1";
16
16
  /* ------------------------------------------------------------------ *
17
17
  * 发现
18
18
  * ------------------------------------------------------------------ */
package/docs/protocol.md CHANGED
@@ -106,7 +106,10 @@ GET /health
106
106
  POST /capabilities/:name/invoke
107
107
  ```
108
108
 
109
- 外加向 Control Plane 的三个动作:`register` / `heartbeat` / `update manifest`。
109
+ 外加向**本机 node agent** 报备(见 §6)。注意这里已经不是早期草案里的
110
+ `register / heartbeat / update manifest` 三件套:heartbeat 被砍了——存活由
111
+ tailnet(Node 层)加 agent 探 `/health`(Service 层)负责,push 心跳既多余
112
+ 又让 L2 反过来依赖 L3。
110
113
 
111
114
  **不要为了统一而把一切硬塞进 `/invoke`。** 特殊 Service 保留原生协议:
112
115
 
@@ -256,6 +259,23 @@ tailnet + 探 36908 自己拼出来。
256
259
 
257
260
  包装优先级 `MCP > CLI > HTTP`,但**第一版不做自动 fallback 编排**,手工声明即可。
258
261
 
262
+ **`access` 数组是有序的:靠前的优先,靠后的是 fallback。** 同一个 protocol
263
+ 出现多次是合法且有用的:
264
+
265
+ ```json
266
+ "access": [
267
+ { "protocol": "http", "base_url": "http://scott-mac.tailfb4720.ts.net:7777/v1" },
268
+ { "protocol": "http", "base_url": "http://100.88.227.56:7777/v1" }
269
+ ]
270
+ ```
271
+
272
+ MagicDNS 名放前面(可读,IP 变了也不用改 manifest),tailnet IP 兜底。
273
+ **这不是多余的**——调用方的 DNS 可能被劫持:实测一台装了 fake-ip 代理的 Mac
274
+ 会把 `iclaw-6e78b1` 解析到 `198.18.1.113`,直连 `100.75.105.79` 才通。
275
+ 只给 DNS 名的话,那台机器就永远连不上这个服务。
276
+
277
+ 调用方按顺序试,第一个连通的就用。
278
+
259
279
  `acp` 与前三者不是一回事:MCP/CLI/HTTP 面向 Capability 与 Resource,
260
280
  ACP 面向 Agent Runtime 的 Session 控制(`agent.session.new` / `prompt` / `cancel` /
261
281
  `status` / `resume`)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1agents/dreammate-network",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "DreamMate Network L0 协议包:schema + types,零运行时依赖,不含业务逻辑。",
5
5
  "keywords": [
6
6
  "dreammate",