@1agents/dreammate-network 0.5.0 → 0.7.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/CHANGELOG.md +176 -0
- package/README.md +221 -16
- package/dist/typescript/types.d.ts +160 -4
- package/dist/typescript/types.js +1 -1
- package/docs/protocol.md +301 -15
- package/package.json +9 -3
- package/schemas/delegation.schema.json +177 -0
- package/schemas/execution.schema.json +2 -2
- package/schemas/governance.schema.json +129 -0
- package/schemas/message.schema.json +135 -0
- package/schemas/service.schema.json +1 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://dreammate.work/schemas/governance.schema.json",
|
|
4
|
+
"title": "DreamMate Actor Reference",
|
|
5
|
+
"description": "治理域的公共词汇:谁在行动(ActorRef)、以什么模式行动(LifecycleMode)、产物版本与验收结论(RevisionRef / ReviewStatus)、角色引用(RoleRef)、双钥匙高危提案的分类(GovernanceProposalKind)、过程审批的种类与结论(ProcessRequestKind / ProcessRequestOutcome)。这里只定义跨仓共用的分类词,不定义任何一方的流程:谁能裁决、要不要留证、状态怎么推进、提案怎么走完,都留在各自仓。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["kind"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"kind": {
|
|
10
|
+
"$ref": "#/$defs/actorKind"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"type": ["string", "null"],
|
|
14
|
+
"description": "行动者的稳定标识。人没有账号时也要给一个可区分的 id。",
|
|
15
|
+
"examples": ["scott", "coach-pm-01"]
|
|
16
|
+
},
|
|
17
|
+
"agent": {
|
|
18
|
+
"type": ["string", "null"],
|
|
19
|
+
"description": "行动者使用的 agent / 模型名。与 id 正交:同一个人可以换 agent。",
|
|
20
|
+
"examples": ["minimax-cn/MiniMax-M3.1-Flash"]
|
|
21
|
+
},
|
|
22
|
+
"session_id": {
|
|
23
|
+
"type": ["string", "null"],
|
|
24
|
+
"description": "行动者所在的会话。可以是本地 session id,也可以是 session:// URI。",
|
|
25
|
+
"examples": ["session://scott-mac/codex/01a0907c"]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"$defs": {
|
|
29
|
+
"actorKind": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"enum": ["person", "coach", "executor", "qa", "host", "application"],
|
|
32
|
+
"description": "行动者类别。person=真实的人,coach=负责给建议与把关的智能体,executor=实际干活的智能体,qa=独立复核方,host=宿主运行时,application=无智能体参与的应用。",
|
|
33
|
+
"examples": ["person", "coach", "executor"]
|
|
34
|
+
},
|
|
35
|
+
"lifecycleMode": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"enum": ["trial", "formal"],
|
|
38
|
+
"description": "这次工作处于什么模式。trial=试跑,产出可以丢弃、可以重来;formal=正式,产出要留痕、要被验收。它说的是这次工作的分量,与谁来干、用什么传输无关。",
|
|
39
|
+
"examples": ["trial", "formal"]
|
|
40
|
+
},
|
|
41
|
+
"reviewStatus": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"enum": ["pending", "accepted", "changes_requested"],
|
|
44
|
+
"description": "产物被验收的结论。changes_requested 是「已看过、但要求返工」——它和 rejected 不是一回事,前者还能继续改,后者是终态否定。",
|
|
45
|
+
"examples": ["pending", "accepted"]
|
|
46
|
+
},
|
|
47
|
+
"revisionRef": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"title": "Revision Reference",
|
|
50
|
+
"description": "产物的一次具体版本。revision 与 digest 一起构成乐观锁:拿着旧的 revision 去提交会被拒绝,避免覆盖掉别人刚交的新版本。",
|
|
51
|
+
"required": ["revision", "digest"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"revision": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"minLength": 1,
|
|
56
|
+
"description": "版本标识,由产出方定义(如递增号或 revision id)。"
|
|
57
|
+
},
|
|
58
|
+
"digest": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"minLength": 1,
|
|
61
|
+
"description": "该版本内容的内容摘要(如 sha256)。",
|
|
62
|
+
"examples": ["sha256:9f2c1e..."]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"roleRef": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"title": "Role Reference",
|
|
69
|
+
"description": "对某个角色的引用。只给 id,不给角色的内容——角色的指令、检查项、评测集是各自仓的资产,不进协议。",
|
|
70
|
+
"required": ["id"],
|
|
71
|
+
"properties": {
|
|
72
|
+
"id": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"minLength": 1,
|
|
75
|
+
"description": "角色标识。",
|
|
76
|
+
"examples": ["pr-delivery", "ticket-reviewer"]
|
|
77
|
+
},
|
|
78
|
+
"name": {
|
|
79
|
+
"type": ["string", "null"],
|
|
80
|
+
"description": "人类可读名称,可省略。"
|
|
81
|
+
},
|
|
82
|
+
"session_id": {
|
|
83
|
+
"type": ["string", "null"],
|
|
84
|
+
"description": "该角色当前的会话引用,可省略。",
|
|
85
|
+
"examples": ["session://scott-mac/codex/01a0907c"]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"governanceProposalKind": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"enum": ["eval_change", "permission_escalation", "promote_formal"],
|
|
92
|
+
"description": "双钥匙高危提案的分类。这三类会改动评测、放宽权限、或把试跑升为正式,因此需要人逐条裁决。「谁批、怎么留证」是各自仓的规则,协议只认这三个分类词。",
|
|
93
|
+
"examples": ["eval_change", "promote_formal"]
|
|
94
|
+
},
|
|
95
|
+
"processRequestKind": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"enum": ["permission", "question", "plan"],
|
|
98
|
+
"description": "过程审批请求的种类。permission=要放行一次工具或权限使用,question=要人回答一个问题,plan=要人认可一份计划。",
|
|
99
|
+
"examples": ["permission", "plan"]
|
|
100
|
+
},
|
|
101
|
+
"processRequestOutcome": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"enum": ["approved", "rejected", "canceled", "accepted", "abandoned"],
|
|
104
|
+
"description": "过程审批请求的结论。approved=放行,rejected=拒绝,canceled=请求方自己撤销,accepted=人认可了内容,abandoned=挂起后无人处理。拼写统一单 l 的 canceled。",
|
|
105
|
+
"examples": ["approved", "canceled"]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"examples": [
|
|
109
|
+
{
|
|
110
|
+
"kind": "person",
|
|
111
|
+
"id": "scott"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"kind": "coach",
|
|
115
|
+
"id": "coach-pm-01",
|
|
116
|
+
"agent": "minimax-cn/MiniMax-M3.1-Flash",
|
|
117
|
+
"session_id": "session://scott-mac/codex/01a0907c"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"kind": "executor",
|
|
121
|
+
"id": "agent-worker-07",
|
|
122
|
+
"session_id": "session://scott-mac/claude/9c11ab02"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"kind": "application",
|
|
126
|
+
"id": "a2a-gateway"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://dreammate.work/schemas/message.schema.json",
|
|
4
|
+
"title": "DreamMate Session Message Envelope",
|
|
5
|
+
"description": "跨会话投递与外部事件的结构化信封(纯数据)。投递方式只出现在 delivery_mode,传输细节(HTTP/MCP、队列长度、合并算法、重试策略)不在这里;正文的渲染格式由发送方决定,协议只约定结构。信封里的 from_session_id 让接收方知道是谁在跟它说话。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["from_session_id"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"from_session_id": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"minLength": 1,
|
|
12
|
+
"description": "发件方的会话 id。",
|
|
13
|
+
"examples": ["session-c8fde7a1-64c0-4943-ad40-b08bfbacefe9"]
|
|
14
|
+
},
|
|
15
|
+
"delivery_mode": {
|
|
16
|
+
"anyOf": [
|
|
17
|
+
{ "$ref": "#/$defs/sessionDeliveryMode" },
|
|
18
|
+
{ "type": "null" }
|
|
19
|
+
],
|
|
20
|
+
"description": "投递方式。省略或为 null 时由接收方按默认处理。"
|
|
21
|
+
},
|
|
22
|
+
"summary": {
|
|
23
|
+
"type": ["string", "null"],
|
|
24
|
+
"description": "一句话摘要。给接收方(或接收方的界面)看,不是正文。",
|
|
25
|
+
"examples": ["dreammate-network L0 守门裁决回复:Stage 0 契约范围 / v0.6.0"]
|
|
26
|
+
},
|
|
27
|
+
"correlation": {
|
|
28
|
+
"anyOf": [
|
|
29
|
+
{ "$ref": "#/$defs/correlation" },
|
|
30
|
+
{ "type": "null" }
|
|
31
|
+
],
|
|
32
|
+
"description": "这条消息挂着的上下文。没有对应上下文时为 null 或整个省略。"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"$defs": {
|
|
36
|
+
"sessionDeliveryMode": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": ["queue", "steer"],
|
|
39
|
+
"description": "投递方式。queue=排进对方当前的待发队列,等它忙完再消费;steer=插队,立刻打断。steer 不会被合并。名字里带 Session 是为了避开别的仓已有的 `DeliveryMode`(那指的是产物怎么落地)——同名不同义比缺名字更危险。",
|
|
40
|
+
"examples": ["queue", "steer"]
|
|
41
|
+
},
|
|
42
|
+
"correlation": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"title": "Message Correlation",
|
|
45
|
+
"description": "这条消息挂在哪个上下文上。一个会话同时承载群聊、私聊与审批时,靠它防止上下文串台。字段全是可选的:没有对应上下文就整个省略。",
|
|
46
|
+
"properties": {
|
|
47
|
+
"ticket_id": {
|
|
48
|
+
"type": ["string", "null"],
|
|
49
|
+
"description": "关联的任务单 id。"
|
|
50
|
+
},
|
|
51
|
+
"team_id": {
|
|
52
|
+
"type": ["string", "null"],
|
|
53
|
+
"description": "关联的团队 id。"
|
|
54
|
+
},
|
|
55
|
+
"job_id": {
|
|
56
|
+
"type": ["string", "null"],
|
|
57
|
+
"description": "关联的作业 id。"
|
|
58
|
+
},
|
|
59
|
+
"a2a_task_id": {
|
|
60
|
+
"type": ["string", "null"],
|
|
61
|
+
"description": "关联的远端 A2A task id。**不透明外部 id**,与 TaskExecutionLink.task_id 无关。"
|
|
62
|
+
},
|
|
63
|
+
"pending_approval_id": {
|
|
64
|
+
"type": ["string", "null"],
|
|
65
|
+
"description": "关联的待审批请求 id。"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"notificationEvent": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"title": "Notification Event",
|
|
72
|
+
"description": "一次外部事件的公共信封。source + event_id 是幂等键:同一对值重复投递只算一次。它只描述「发生了什么」,不描述「投给谁、怎么投」——路由是服务端的行为。",
|
|
73
|
+
"required": ["source", "event_id", "summary"],
|
|
74
|
+
"properties": {
|
|
75
|
+
"source": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"minLength": 1,
|
|
78
|
+
"description": "事件来源标识。",
|
|
79
|
+
"examples": ["rsi-evolver", "dreammate-network"]
|
|
80
|
+
},
|
|
81
|
+
"event_id": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"minLength": 1,
|
|
84
|
+
"description": "来源侧的事件唯一 id,与 source 一起构成幂等键。",
|
|
85
|
+
"examples": ["brief-2026-11-28-01"]
|
|
86
|
+
},
|
|
87
|
+
"event_type": {
|
|
88
|
+
"type": ["string", "null"],
|
|
89
|
+
"description": "事件类型标识,可省略。"
|
|
90
|
+
},
|
|
91
|
+
"summary": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"minLength": 1,
|
|
94
|
+
"description": "一句话说明这次事件。"
|
|
95
|
+
},
|
|
96
|
+
"occurred_at": {
|
|
97
|
+
"type": ["string", "null"],
|
|
98
|
+
"format": "date-time",
|
|
99
|
+
"description": "事件发生的时间,可省略。"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"examples": [
|
|
105
|
+
{
|
|
106
|
+
"from_session_id": "session-c8fde7a1-64c0-4943-ad40-b08bfbacefe9",
|
|
107
|
+
"delivery_mode": "queue",
|
|
108
|
+
"summary": "dreammate-network L0 守门裁决回复:Stage 0 契约范围 / v0.6.0",
|
|
109
|
+
"correlation": {
|
|
110
|
+
"ticket_id": "ticket-2041",
|
|
111
|
+
"job_id": "job-0ba07988",
|
|
112
|
+
"a2a_task_id": "a2a-task-8f21c0",
|
|
113
|
+
"pending_approval_id": null
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"from_session_id": "session-267d01f9-3b1b-4652-a4bd-2f38dbdf9471",
|
|
118
|
+
"delivery_mode": "steer",
|
|
119
|
+
"summary": "四项拍板点已表态,等 dsh-superagent 同步",
|
|
120
|
+
"correlation": {
|
|
121
|
+
"ticket_id": null,
|
|
122
|
+
"team_id": null,
|
|
123
|
+
"job_id": null,
|
|
124
|
+
"a2a_task_id": null,
|
|
125
|
+
"pending_approval_id": "approval-31"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"from_session_id": "session-eafe2ed4-e78b-4ae3-a9e1-d649ff00ad43",
|
|
130
|
+
"delivery_mode": null,
|
|
131
|
+
"summary": null,
|
|
132
|
+
"correlation": null
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
}
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"localhost",
|
|
150
150
|
"network"
|
|
151
151
|
],
|
|
152
|
-
"description": "
|
|
152
|
+
"description": "服务自己怎么监听。localhost=只绑回环,外部不能直连其端口;network=监听 0.0.0.0 或 tailnet 地址,外部可直连。node agent 在 manifest 里如实转述。跨节点调用走 agent 的统一入口(POST /services/:id/invoke 或 MCP dreammate_invoke),由本机 agent 转发到回环 HTTP 或 CLI。省略时按 network 理解。"
|
|
153
153
|
},
|
|
154
154
|
"execution": {
|
|
155
155
|
"type": "string",
|