@1agents/dreammate-network 0.4.0 → 0.5.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.
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* 协议版本,与本包的 package.json 版本保持一致——两个版本号会让人永远猜不准
|
|
13
13
|
* 该看哪个。服务在 `manifest.metadata.protocol_version` 里报告它遵循的版本。
|
|
14
14
|
*/
|
|
15
|
-
export declare const PROTOCOL_VERSION = "0.
|
|
15
|
+
export declare const PROTOCOL_VERSION = "0.5.0";
|
|
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` */
|
|
@@ -131,11 +131,30 @@ export interface SkillDescriptor {
|
|
|
131
131
|
has_package?: boolean;
|
|
132
132
|
metadata?: Record<string, unknown>;
|
|
133
133
|
}
|
|
134
|
+
/** 服务调用方式:cli=仅命令行;http=仅常驻HTTP;hybrid=双模兼容,优先CLI。 */
|
|
135
|
+
export type ExecutionMode = "cli" | "http" | "hybrid";
|
|
136
|
+
/** 服务启停生命周期规范,声明能否被网关按需拉起或关闭。 */
|
|
137
|
+
export interface ServiceLifecycle {
|
|
138
|
+
/** 如何拉起该服务的常驻进程(如 'transcribe serve --port 7782')。 */
|
|
139
|
+
start_command?: string;
|
|
140
|
+
/** 如何通过 HTTP 关闭该服务(如 '/shutdown')。 */
|
|
141
|
+
stop_endpoint?: string;
|
|
142
|
+
/** 是否支持被 node agent 自动拉起。 */
|
|
143
|
+
can_spawn?: boolean;
|
|
144
|
+
/** 是否支持被 node agent 请求关闭。 */
|
|
145
|
+
can_shutdown?: boolean;
|
|
146
|
+
}
|
|
134
147
|
export interface Service {
|
|
135
148
|
id: string;
|
|
136
149
|
name?: string | null;
|
|
137
150
|
/** 省略等同于 `"generic"` */
|
|
138
151
|
kind?: ServiceKind;
|
|
152
|
+
/** 服务调用模式:cli | http | hybrid(默认 hybrid)。 */
|
|
153
|
+
execution?: ExecutionMode;
|
|
154
|
+
/** 执行指令或可执行文件名称(如 'transcribe')。 */
|
|
155
|
+
command?: string;
|
|
156
|
+
/** 服务的启停生命周期控制参数。 */
|
|
157
|
+
lifecycle?: ServiceLifecycle;
|
|
139
158
|
/**
|
|
140
159
|
* @deprecated 历史遗留字段,新服务请直接使用 `methods` 与 `skills`。
|
|
141
160
|
*/
|
|
@@ -151,7 +170,7 @@ export interface Service {
|
|
|
151
170
|
* 声明而**不做代理**——调用方看到 `localhost` 就知道不用白跑一趟。
|
|
152
171
|
*/
|
|
153
172
|
reachability?: Reachability;
|
|
154
|
-
/**
|
|
173
|
+
/** 实际监听端口。纯 CLI 模式可省略。不必等于 {@link DEFAULT_PORTS} 里的默认值。 */
|
|
155
174
|
port?: number | null;
|
|
156
175
|
/** 存活探测路径,默认 `/health`。 */
|
|
157
176
|
health?: string | null;
|
package/dist/typescript/types.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* 协议版本,与本包的 package.json 版本保持一致——两个版本号会让人永远猜不准
|
|
13
13
|
* 该看哪个。服务在 `manifest.metadata.protocol_version` 里报告它遵循的版本。
|
|
14
14
|
*/
|
|
15
|
-
export const PROTOCOL_VERSION = "0.
|
|
15
|
+
export const PROTOCOL_VERSION = "0.5.0";
|
|
16
16
|
/* ------------------------------------------------------------------ *
|
|
17
17
|
* 发现
|
|
18
18
|
* ------------------------------------------------------------------ */
|
package/package.json
CHANGED
|
@@ -151,6 +151,42 @@
|
|
|
151
151
|
],
|
|
152
152
|
"description": "这个 Service 能被谁连上。localhost=只监听回环,外部节点发现得了但连不上;network=监听 0.0.0.0 或 tailnet 地址,外部可直连。node agent 如实转述服务自己的声明,不做代理——调用方看到 localhost 就知道不用白跑一趟。省略时按 network 理解。"
|
|
153
153
|
},
|
|
154
|
+
"execution": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"enum": [
|
|
157
|
+
"cli",
|
|
158
|
+
"http",
|
|
159
|
+
"hybrid"
|
|
160
|
+
],
|
|
161
|
+
"default": "hybrid",
|
|
162
|
+
"description": "服务调用执行模式:cli=仅本地命令行;http=仅常驻HTTP服务;hybrid=双模兼容,优先本地CLI执行,亦可按需拉起常驻HTTP。"
|
|
163
|
+
},
|
|
164
|
+
"command": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"description": "execution 为 cli 或 hybrid 时对应的执行指令或可执行文件名称(如 'transcribe')。"
|
|
167
|
+
},
|
|
168
|
+
"lifecycle": {
|
|
169
|
+
"type": "object",
|
|
170
|
+
"description": "服务启停生命周期规范,声明能否被网关按需拉起和关闭及对应参数。",
|
|
171
|
+
"properties": {
|
|
172
|
+
"start_command": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"description": "如何拉起该服务的常驻进程(如 'transcribe serve --port 7782')。"
|
|
175
|
+
},
|
|
176
|
+
"stop_endpoint": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"description": "如何通过 HTTP 关闭该服务(如 '/shutdown')。"
|
|
179
|
+
},
|
|
180
|
+
"can_spawn": {
|
|
181
|
+
"type": "boolean",
|
|
182
|
+
"description": "是否支持被 node agent 自动拉起。"
|
|
183
|
+
},
|
|
184
|
+
"can_shutdown": {
|
|
185
|
+
"type": "boolean",
|
|
186
|
+
"description": "是否支持被 node agent 请求关闭。"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
154
190
|
"port": {
|
|
155
191
|
"type": [
|
|
156
192
|
"integer",
|
|
@@ -158,7 +194,7 @@
|
|
|
158
194
|
],
|
|
159
195
|
"minimum": 1,
|
|
160
196
|
"maximum": 65535,
|
|
161
|
-
"description": "服务实际监听的端口。向本机 node agent
|
|
197
|
+
"description": "服务实际监听的端口。向本机 node agent 报备时带上,外部才知道该连哪儿;纯 CLI 模式可省略。"
|
|
162
198
|
},
|
|
163
199
|
"health": {
|
|
164
200
|
"type": [
|