@sleep2agi/agent-network 2.3.0-preview.90 → 2.3.0-preview.92
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/bin/cli.js +2 -2
- package/dist/src/client.js +1 -1
- package/dist/src/copresence-identity.d.ts +14 -0
- package/dist/src/hub-health-timeout.d.ts +4 -0
- package/dist/src/node-server.js +7 -7
- package/dist/src/opencode-agent-node-pair.d.ts +2 -2
- package/dist/src/outbound-attachments.d.ts +3 -0
- package/dist/src/reply-local-links.d.ts +47 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const PAIRED_AGENT_NETWORK_VERSION = "2.3.0-preview.
|
|
1
|
+
export declare const PAIRED_AGENT_NETWORK_VERSION = "2.3.0-preview.92";
|
|
2
2
|
export declare const PAIRED_AGENT_NODE_VERSION = "2.5.0-preview.69";
|
|
3
3
|
export declare const PAIRED_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.69";
|
|
4
|
-
export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.
|
|
4
|
+
export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.92";
|
|
5
5
|
export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.69";
|
|
6
6
|
export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.69";
|
|
7
7
|
export type PairedAgentNodeResolution = {
|
|
@@ -20,6 +20,9 @@ export type NormalizeResult = {
|
|
|
20
20
|
* without attachments must produce a byte-identical request to before this
|
|
21
21
|
* existed, or every existing reply changes behaviour the day this ships.
|
|
22
22
|
*/
|
|
23
|
+
/** 2026-09-15 —— LLM 常把数组参数当成 JSON 字符串传(TM汇报马 真机:attachments 是 "[{...}]" 字符串,回复 ok:true 但 hub 里没有附件)。
|
|
24
|
+
* 字符串先 parse;parse 不出来是错误,不是「没有附件」。 */
|
|
25
|
+
export declare function coerceAttachmentsArg(input: unknown): unknown;
|
|
23
26
|
export declare function normalizeOutboundAttachments(input: unknown): NormalizeResult;
|
|
24
27
|
/**
|
|
25
28
|
* Spread into a Hub request body. Empty → `{}`, so a call with no attachments
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* claude-code-cli 节点(node-server 通道)回复里的「本机文件链接」→ 自动上传成附件。
|
|
3
|
+
* 与 agent-node 的 runtime/reply-file-links.ts 同一形状(两个包不能互相 import,各放一份纯逻辑)。
|
|
4
|
+
* 2026-09-15 真机:TM汇报马 两条带 pptx 的回复到 hub 时附件为空,人只看到「点卡片下载」四个字。
|
|
5
|
+
*/
|
|
6
|
+
export declare const REPLY_LOCAL_LINK_MAX = 6;
|
|
7
|
+
export interface LocalLink {
|
|
8
|
+
readonly raw: string;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly path: string;
|
|
11
|
+
}
|
|
12
|
+
/** 只认 markdown 链接且目标像本机绝对路径(`/…` 或 `file:///…`);http(s)、/api/files/… 不算。 */
|
|
13
|
+
export declare function findLocalLinks(text: string): LocalLink[];
|
|
14
|
+
export interface UploadedRef {
|
|
15
|
+
file_id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
mime?: string;
|
|
18
|
+
size?: number;
|
|
19
|
+
}
|
|
20
|
+
/** 上传成功的链接目标改成 /api/files/<id>(客户端按附件卡片渲染),失败的在标签后注明原因;返回 attachments 数组。 */
|
|
21
|
+
export declare function rewriteLocalLinks(text: string, results: ReadonlyArray<{
|
|
22
|
+
link: LocalLink;
|
|
23
|
+
uploaded?: UploadedRef;
|
|
24
|
+
reason?: string;
|
|
25
|
+
}>): {
|
|
26
|
+
text: string;
|
|
27
|
+
attachments: Array<{
|
|
28
|
+
type: "file";
|
|
29
|
+
file_id: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
mime?: string;
|
|
32
|
+
size?: number;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
/** 端到端(上传函数注入,失败抛错即可):没有本机链接时原样返回、零副作用。 */
|
|
36
|
+
export declare function attachLocalLinks(text: string, upload: (path: string) => Promise<UploadedRef>): Promise<{
|
|
37
|
+
text: string;
|
|
38
|
+
attachments: Array<{
|
|
39
|
+
type: "file";
|
|
40
|
+
file_id: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
mime?: string;
|
|
43
|
+
size?: number;
|
|
44
|
+
}>;
|
|
45
|
+
uploaded: number;
|
|
46
|
+
failed: number;
|
|
47
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleep2agi/agent-network",
|
|
3
|
-
"version": "2.3.0-preview.
|
|
3
|
+
"version": "2.3.0-preview.92",
|
|
4
4
|
"description": "AI Agent Network CLI — Local-first multi-agent orchestration across 6 runtimes (Claude Code CLI / Claude Agent SDK / Codex SDK / Codex app-server / Grok Build ACP / OpenCode CLI) and 8+ LLM providers. Apache 2.0.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/client.js",
|