@xdxer/dingtalk-agent 0.1.5-beta.3 → 0.1.5-beta.4

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.en.md +92 -65
  3. package/README.md +92 -65
  4. package/dist/bin/dingtalk-agent.js +142 -15
  5. package/dist/bin/dingtalk-agent.js.map +1 -1
  6. package/dist/src/agent-platform.js +1 -0
  7. package/dist/src/agent-platform.js.map +1 -1
  8. package/dist/src/development-workspace.js +66 -3
  9. package/dist/src/development-workspace.js.map +1 -1
  10. package/dist/src/multica-deploy.js +101 -9
  11. package/dist/src/multica-deploy.js.map +1 -1
  12. package/dist/src/multica-provider.js +157 -2
  13. package/dist/src/multica-provider.js.map +1 -1
  14. package/dist/src/schedule-plan.js +105 -0
  15. package/dist/src/schedule-plan.js.map +1 -0
  16. package/docs/ARCHITECTURE.md +133 -18
  17. package/docs/PRIOR-ART.md +4 -0
  18. package/docs/SELF-TEST.md +1 -1
  19. package/docs/architecture/agent-platform-connection-layer.svg +120 -0
  20. package/docs/architecture/digital-employee-composition.svg +92 -0
  21. package/docs/architecture/dingtalk-agent-architecture.svg +125 -0
  22. package/docs/assets/digital-employee-at-work.svg +77 -0
  23. package/docs/schemas/multica-workspace-run.schema.json +150 -33
  24. package/docs/schemas/project.schema.json +22 -0
  25. package/docs/schemas/workspace-scaffold.schema.json +37 -0
  26. package/examples/agents/README.md +1 -1
  27. package/lab/project-workspace/fake-multica-provider.mjs +18 -2
  28. package/lab/project-workspace/opencode-provider-suite.json +1 -1
  29. package/lab/robot-eval/suite.json +1 -1
  30. package/package.json +2 -2
  31. package/skills/core/dingtalk-agent-compose/SKILL.md +4 -3
  32. package/skills/core/dingtalk-agent-compose/assets/AGENTS.template.md +1 -1
  33. package/skills/core/dingtalk-agent-compose/references/drive-and-schedules.md +124 -0
  34. package/skills/core/dingtalk-basic-behavior/SKILL.md +5 -4
  35. package/skills/core/dingtalk-basic-behavior/references/event-to-behavior.md +15 -1
  36. package/skills/core/dingtalk-basic-behavior/references/perception-and-gates.md +3 -0
  37. package/skills/core/dingtalk-basic-behavior/references/risk-authority-and-privacy.md +12 -0
  38. package/skills/platforms/deap/PLATFORM.md +30 -1
  39. package/skills/platforms/multica-dingtalk/PLATFORM.md +25 -0
  40. package/skills/platforms/multica-dingtalk/dingtalk-agent-deploy-multica/SKILL.md +3 -2
  41. package/skills/platforms/multica-dingtalk/multica-external/SKILL.md +15 -0
  42. package/docs/assets/agent-delivery-lifecycle.svg +0 -103
@@ -0,0 +1,125 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 880" width="1200" height="880" role="img" aria-labelledby="title desc">
2
+ <title id="title">dingtalk-agent 架构:五个部件,五个权威</title>
3
+ <desc id="desc">一个数字员工由五个部件构成,编号一到五:部件一 Agent 本体由本仓库拥有,内含可信事件、响应闸门、Session Run Wait、动作闸门与 Receipt 回读的处理链,以及本体装配、状态记忆、评测证据三块支撑;部件二组织身份与场域授权、部件三感知通道由钉钉数字员工平台提供,当前尚未接入;部件四平台执行能力由 DWS 提供,执行全部真实钉钉操作并回读 Receipt;部件五运行位置由 Managed Agent Platform 或本地 Agent Host 提供,Multica 已支持、DEAP 敬请期待、更多平台需先在注册表登记并提供平台 Skill 包。最底层是钉钉组织。</desc>
4
+ <style>
5
+ text { font-family: 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif; }
6
+ .title { fill:#111827;font-size:22px;font-weight:700; }
7
+ .subtitle { fill:#6b7280;font-size:13px; }
8
+ .lane { fill:#475569;font-size:12px;font-weight:700;letter-spacing:.08em; }
9
+ .node-title { fill:#111827;font-size:15px;font-weight:700; }
10
+ .node-sub { fill:#4b5563;font-size:12px; }
11
+ .small { fill:#64748b;font-size:11px; }
12
+ .label { fill:#475569;font-size:11px;font-weight:600; }
13
+ .footer { fill:#ffffff;font-size:11px;font-weight:600; }
14
+ .badge-on { fill:#ffffff;font-size:12px;font-weight:700; }
15
+ </style>
16
+ <defs>
17
+ <marker id="arrow-blue" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto"><polygon points="0 0, 10 3.5, 0 7" fill="#2563eb"/></marker>
18
+ <marker id="arrow-gray" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto"><polygon points="0 0, 10 3.5, 0 7" fill="#64748b"/></marker>
19
+ <marker id="arrow-purple" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto"><polygon points="0 0, 10 3.5, 0 7" fill="#7c3aed"/></marker>
20
+ <marker id="arrow-teal" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto"><polygon points="0 0, 10 3.5, 0 7" fill="#0d9488"/></marker>
21
+ </defs>
22
+ <rect width="1200" height="880" fill="#ffffff"/>
23
+ <text x="40" y="46" class="title">dingtalk-agent 架构:五个部件,五个权威,本仓库只拥有一个</text>
24
+ <text x="40" y="70" class="subtitle">把 Agent 装配成合格的钉钉数字员工,并连接更广阔的 Agent 运行平台。实心编号 = 本仓库拥有;空心编号 = 外部提供。</text>
25
+ <rect x="40" y="92" width="1120" height="122" rx="8" fill="#f9fafb" stroke="#d1d5db" stroke-width="1.5" stroke-dasharray="7 5"/>
26
+ <circle cx="62" cy="110" r="11" fill="#ffffff" stroke="#64748b" stroke-width="1.6"/>
27
+ <text x="62" y="114" text-anchor="middle" fill="#64748b" font-size="12" font-weight="700">5</text>
28
+ <text x="82" y="115" class="lane">RUNTIME LOCATION · 运行位置(可替换)—— Agent 在哪里执行,本仓库不自建 Runtime</text>
29
+ <rect x="64" y="128" width="247" height="70" rx="8" fill="#f0fdf4" stroke="#86efac" stroke-width="1.5"/>
30
+ <text x="187" y="156" text-anchor="middle" class="node-title">Multica</text>
31
+ <text x="187" y="178" text-anchor="middle" class="node-sub">已支持</text>
32
+ <rect x="339" y="128" width="247" height="70" rx="8" fill="#faf5ff" stroke="#c084fc" stroke-width="1.5" stroke-dasharray="6 4"/>
33
+ <text x="462" y="156" text-anchor="middle" class="node-title">DEAP</text>
34
+ <text x="462" y="178" text-anchor="middle" class="node-sub">敬请期待 · 是否内建运行平台待确认</text>
35
+ <rect x="614" y="128" width="247" height="70" rx="8" fill="#f9fafb" stroke="#d1d5db" stroke-width="1.5" stroke-dasharray="6 4"/>
36
+ <text x="737" y="156" text-anchor="middle" class="node-title">更多平台</text>
37
+ <text x="737" y="178" text-anchor="middle" class="node-sub">注册表 + 平台 Skill 包</text>
38
+ <rect x="889" y="128" width="247" height="70" rx="8" fill="#ffffff" stroke="#d1d5db" stroke-width="1.5"/>
39
+ <text x="1012" y="156" text-anchor="middle" class="node-title">本地 Agent Host</text>
40
+ <text x="1012" y="178" text-anchor="middle" class="node-sub">Claude Code · Codex · OpenCode</text>
41
+ <path d="M 600,268 L 600,220" fill="none" stroke="#64748b" stroke-width="1.5" stroke-dasharray="5 4" marker-end="url(#arrow-gray)"/>
42
+ <rect x="610" y="232" width="190" height="19" rx="4" fill="#ffffff" opacity="0.95"/>
43
+ <text x="704" y="246" text-anchor="middle" class="label">部署 · Definition 与 Skill 树</text>
44
+ <rect x="40" y="268" width="1120" height="292" rx="8" fill="#f8fafc" stroke="#0f766e" stroke-width="2"/>
45
+ <circle cx="62" cy="288" r="11" fill="#0f766e"/>
46
+ <text x="62" y="292" text-anchor="middle" class="badge-on">1</text>
47
+ <text x="82" y="292" fill="#0f766e" font-size="12" font-weight="700" letter-spacing=".08em">DINGTALK-AGENT · 本仓库唯一拥有的一项:Agent 本体 · 公共行为 · 状态 · 效果证据</text>
48
+ <text x="82" y="312" class="small">Skill 劝(该不该做)· CLI 拦(身份 / 目标 / 预算 / 幂等 / 回读)· DWS 做(执行)</text>
49
+ <rect x="64" y="326" width="187" height="92" rx="8" fill="#eff6ff" stroke="#60a5fa" stroke-width="1.8"/>
50
+ <text x="157" y="356" text-anchor="middle" class="node-title">可信事件</text>
51
+ <text x="157" y="378" text-anchor="middle" class="node-sub">Invocation</text>
52
+ <text x="157" y="397" text-anchor="middle" class="small">谁 · 在哪 · 说了什么</text>
53
+ <rect x="285" y="326" width="187" height="92" rx="8" fill="#eff6ff" stroke="#60a5fa" stroke-width="1.8"/>
54
+ <text x="378" y="356" text-anchor="middle" class="node-title">Response Gate</text>
55
+ <text x="378" y="378" text-anchor="middle" class="node-sub">mention/DM 才处理</text>
56
+ <text x="378" y="397" text-anchor="middle" class="small">群聊未 @ 默认沉默</text>
57
+ <rect x="506" y="326" width="187" height="92" rx="8" fill="#eff6ff" stroke="#60a5fa" stroke-width="1.8"/>
58
+ <text x="599" y="356" text-anchor="middle" class="node-title">Session·Run·Wait</text>
59
+ <text x="599" y="378" text-anchor="middle" class="node-sub">一件事 · 一次唤醒</text>
60
+ <text x="599" y="397" text-anchor="middle" class="small">沙箱可丢弃,事情接着做</text>
61
+ <rect x="727" y="326" width="187" height="92" rx="8" fill="#eff6ff" stroke="#60a5fa" stroke-width="1.8"/>
62
+ <text x="820" y="356" text-anchor="middle" class="node-title">Action Gate</text>
63
+ <text x="820" y="378" text-anchor="middle" class="node-sub">冻结身份 · 目标 · 预算</text>
64
+ <text x="820" y="397" text-anchor="middle" class="small">幂等,不盲重试</text>
65
+ <rect x="948" y="326" width="187" height="92" rx="8" fill="#eff6ff" stroke="#60a5fa" stroke-width="1.8"/>
66
+ <text x="1041" y="356" text-anchor="middle" class="node-title">Receipt</text>
67
+ <text x="1041" y="378" text-anchor="middle" class="node-sub">独立回读</text>
68
+ <text x="1041" y="397" text-anchor="middle" class="small">无证据不声称完成</text>
69
+ <path d="M 251,372 L 285,372" fill="none" stroke="#2563eb" stroke-width="2" marker-end="url(#arrow-blue)"/>
70
+ <path d="M 472,372 L 506,372" fill="none" stroke="#2563eb" stroke-width="2" marker-end="url(#arrow-blue)"/>
71
+ <path d="M 693,372 L 727,372" fill="none" stroke="#2563eb" stroke-width="2" marker-end="url(#arrow-blue)"/>
72
+ <path d="M 914,372 L 948,372" fill="none" stroke="#2563eb" stroke-width="2" marker-end="url(#arrow-blue)"/>
73
+ <rect x="64" y="440" width="337" height="92" rx="8" fill="#ffffff" stroke="#93c5fd" stroke-width="1.5"/>
74
+ <text x="232" y="468" text-anchor="middle" class="node-title">本体与装配</text>
75
+ <text x="232" y="490" text-anchor="middle" class="node-sub">Definition + Basic Behavior + Role Skills</text>
76
+ <text x="232" y="509" text-anchor="middle" class="small">agent enhance · agent audit --verify-load</text>
77
+ <rect x="431" y="440" width="337" height="92" rx="8" fill="#ffffff" stroke="#93c5fd" stroke-width="1.5"/>
78
+ <text x="599" y="468" text-anchor="middle" class="node-title">状态与记忆</text>
79
+ <text x="599" y="490" text-anchor="middle" class="node-sub">语义内容与控制状态分开</text>
80
+ <text x="599" y="509" text-anchor="middle" class="small">锁 · 幂等 · Receipt 不进 Markdown</text>
81
+ <rect x="798" y="440" width="337" height="92" rx="8" fill="#ffffff" stroke="#93c5fd" stroke-width="1.5"/>
82
+ <text x="966" y="468" text-anchor="middle" class="node-title">评测与证据</text>
83
+ <text x="966" y="490" text-anchor="middle" class="node-sub">上线前用最低成本证明它真会做事</text>
84
+ <text x="966" y="509" text-anchor="middle" class="small">lab · workspace eval · observe</text>
85
+ <path d="M 158,606 L 158,564" fill="none" stroke="#7c3aed" stroke-width="1.8" stroke-dasharray="6 4" marker-end="url(#arrow-purple)"/>
86
+ <rect x="169" y="572" width="136" height="19" rx="4" fill="#ffffff" opacity="0.95"/>
87
+ <text x="237" y="586" text-anchor="middle" class="label">签发的身份 · 可信事件</text>
88
+ <path d="M 821,564 L 821,606" fill="none" stroke="#0d9488" stroke-width="2" marker-end="url(#arrow-teal)"/>
89
+ <rect x="837" y="572" width="56" height="19" rx="4" fill="#ffffff" opacity="0.95"/>
90
+ <text x="865" y="586" text-anchor="middle" class="label">执行动作</text>
91
+ <path d="M 1042,606 L 1042,564" fill="none" stroke="#0d9488" stroke-width="2" marker-end="url(#arrow-teal)"/>
92
+ <rect x="1058" y="572" width="82" height="19" rx="4" fill="#ffffff" opacity="0.95"/>
93
+ <text x="1099" y="586" text-anchor="middle" class="label">Receipt 回读</text>
94
+ <rect x="40" y="606" width="540" height="140" rx="8" fill="#faf5ff" stroke="#c084fc" stroke-width="1.8" stroke-dasharray="7 5"/>
95
+ <text x="58" y="630" fill="#7c3aed" font-size="12" font-weight="700" letter-spacing=".08em">IDENTITY &amp; PERCEPTION · 钉钉数字员工平台</text>
96
+ <rect x="60" y="646" width="245" height="64" rx="8" fill="#ffffff" stroke="#d8b4fe" stroke-width="1.5"/>
97
+ <circle cx="80" cy="666" r="11" fill="#ffffff" stroke="#7c3aed" stroke-width="1.6"/>
98
+ <text x="80" y="670" text-anchor="middle" fill="#7c3aed" font-size="12" font-weight="700">2</text>
99
+ <text x="183" y="673" text-anchor="middle" class="node-title">身份权限管控</text>
100
+ <text x="183" y="694" text-anchor="middle" class="node-sub">创建 · UID · 场域边界 · 生命周期</text>
101
+ <rect x="320" y="646" width="245" height="64" rx="8" fill="#ffffff" stroke="#d8b4fe" stroke-width="1.5"/>
102
+ <circle cx="340" cy="666" r="11" fill="#ffffff" stroke="#7c3aed" stroke-width="1.6"/>
103
+ <text x="340" y="670" text-anchor="middle" fill="#7c3aed" font-size="12" font-weight="700">3</text>
104
+ <text x="443" y="673" text-anchor="middle" class="node-title">感知与人机交互</text>
105
+ <text x="443" y="694" text-anchor="middle" class="node-sub">事件送达 · 统一展示</text>
106
+ <text x="60" y="730" class="small">DEAP 敬请期待,平台命令一律 fail-closed;事件信封的权威是钉钉事件中心与 DWS。</text>
107
+ <rect x="620" y="606" width="540" height="140" rx="8" fill="#f0fdfa" stroke="#0f766e" stroke-width="1.8"/>
108
+ <text x="638" y="630" fill="#0f766e" font-size="12" font-weight="700" letter-spacing=".08em">PLATFORM EXECUTION · DWS</text>
109
+ <rect x="640" y="646" width="500" height="64" rx="8" fill="#ffffff" stroke="#5eead4" stroke-width="1.5"/>
110
+ <circle cx="660" cy="666" r="11" fill="#ffffff" stroke="#0d9488" stroke-width="1.6"/>
111
+ <text x="660" y="670" text-anchor="middle" fill="#0d9488" font-size="12" font-weight="700">4</text>
112
+ <text x="890" y="673" text-anchor="middle" class="node-title">钉钉全部产品能力</text>
113
+ <text x="890" y="694" text-anchor="middle" class="node-sub">消息 · 文档 · 表格 · 日程 · 审批 · 通讯录</text>
114
+ <text x="640" y="730" class="small">所有真实钉钉操作最终都由 DWS 执行;src/dws.ts 是全仓库唯一 spawn dws 的地方。</text>
115
+ <rect x="40" y="764" width="1120" height="28" rx="6" fill="#0f172a"/>
116
+ <text x="600" y="783" text-anchor="middle" class="footer">钉钉组织 · 真实的人、群、日程、审批与文档 —— 身份与事件由钉钉签发,本仓库只冻结、审计和引用,不发证、不改写、不扩权</text>
117
+ <line x1="40" y1="828" x2="74" y2="828" stroke="#2563eb" stroke-width="1.8" marker-end="url(#arrow-blue)"/>
118
+ <text x="82" y="832" class="small">主处理流:事件 → 资格 → 动作</text>
119
+ <line x1="300" y1="828" x2="334" y2="828" stroke="#64748b" stroke-width="1.8" stroke-dasharray="5 4" marker-end="url(#arrow-gray)"/>
120
+ <text x="342" y="832" class="small">装配与部署(本仓库 → 运行平台)</text>
121
+ <line x1="560" y1="828" x2="594" y2="828" stroke="#7c3aed" stroke-width="1.8" stroke-dasharray="6 4" marker-end="url(#arrow-purple)"/>
122
+ <text x="602" y="832" class="small">钉钉签发的身份与可信事件(DEAP 待接入)</text>
123
+ <line x1="860" y1="828" x2="894" y2="828" stroke="#0d9488" stroke-width="1.8" marker-end="url(#arrow-teal)"/>
124
+ <text x="902" y="832" class="small">DWS 执行与 Receipt 回读</text>
125
+ </svg>
@@ -0,0 +1,77 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 430" width="1200" height="430" role="img" aria-labelledby="title desc">
2
+ <title id="title">一个钉钉数字员工的一次协作</title>
3
+ <desc id="desc">群里有同事 @ 数字员工提出请求;它先确认自己是谁、被授权对谁做事;然后经 DWS 执行真实的钉钉操作;最后拿出可独立回读的回执与产物,才声称完成。全过程留在原来的群里,和真人同事走同一套协作界面。</desc>
4
+ <defs>
5
+ <linearGradient id="bg" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#0a1020"/><stop offset="1" stop-color="#111a31"/></linearGradient>
6
+ <linearGradient id="accent" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#39c6f4"/><stop offset="1" stop-color="#7777ff"/></linearGradient>
7
+ <filter id="shadow" x="-20%" y="-30%" width="140%" height="160%"><feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#020617" flood-opacity=".34"/></filter>
8
+ <style>
9
+ text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
10
+ .eyebrow { font-size:13px;font-weight:600;letter-spacing:1.6px;fill:#7dd3fc; }
11
+ .title { font-size:22px;font-weight:700;fill:#f8fafc; }
12
+ .step { font-size:17px;font-weight:700;fill:#f8fafc; }
13
+ .body { font-size:14px;font-weight:500;fill:#cbd5e1; }
14
+ .small { font-size:12px;font-weight:500;fill:#94a3b8; }
15
+ .bubble { font-size:14px;font-weight:600;fill:#dbeafe; }
16
+ .num { font-size:13px;font-weight:700;fill:#08111f; }
17
+ </style>
18
+ </defs>
19
+ <rect width="1200" height="430" rx="28" fill="url(#bg)"/>
20
+ <path d="M52 96H1148" stroke="#23304a"/>
21
+ <text x="52" y="56" class="eyebrow">A DIGITAL EMPLOYEE AT WORK</text>
22
+ <text x="52" y="86" class="title">群里 @ 它一句话,它像同事一样把事办完——而且每一步都留得下痕迹</text>
23
+ <g filter="url(#shadow)">
24
+ <rect x="52" y="116" width="250" height="188" rx="22" fill="#111c33" stroke="#2b3b59"/>
25
+ <circle cx="84" cy="150" r="15" fill="#67e8f9"/>
26
+ <text x="84" y="155" text-anchor="middle" class="num">1</text>
27
+ <text x="110" y="156" class="step">有人在群里 @ 它</text>
28
+ <rect x="74" y="184" width="206" height="46" rx="10" fill="#172643"/>
29
+ <text x="90" y="204" class="body">真人同事,在原来的群里</text>
30
+ <text x="90" y="222" class="small">不用换工具、不用开新系统</text>
31
+ </g>
32
+ <g filter="url(#shadow)">
33
+ <rect x="340" y="116" width="250" height="188" rx="22" fill="#111c33" stroke="#2b3b59"/>
34
+ <circle cx="372" cy="150" r="15" fill="#67e8f9"/>
35
+ <text x="372" y="155" text-anchor="middle" class="num">2</text>
36
+ <text x="398" y="156" class="step">它先确认自己是谁</text>
37
+ <rect x="362" y="184" width="206" height="46" rx="10" fill="#172643"/>
38
+ <text x="378" y="204" class="body">工号 · 岗位 · 能对谁做事</text>
39
+ <text x="378" y="222" class="small">身份由钉钉签发,不看正文说什么</text>
40
+ </g>
41
+ <g filter="url(#shadow)">
42
+ <rect x="628" y="116" width="250" height="188" rx="22" fill="#111c33" stroke="#2b3b59"/>
43
+ <circle cx="660" cy="150" r="15" fill="#67e8f9"/>
44
+ <text x="660" y="155" text-anchor="middle" class="num">3</text>
45
+ <text x="686" y="156" class="step">它去把事情办了</text>
46
+ <rect x="650" y="184" width="206" height="46" rx="10" fill="#172643"/>
47
+ <text x="666" y="204" class="body">查状态 · 发通知 · 写文档</text>
48
+ <text x="666" y="222" class="small">每个动作都过一道闸门</text>
49
+ </g>
50
+ <g filter="url(#shadow)">
51
+ <rect x="916" y="116" width="232" height="188" rx="22" fill="#111c33" stroke="#2b3b59"/>
52
+ <circle cx="948" cy="150" r="15" fill="#67e8f9"/>
53
+ <text x="948" y="155" text-anchor="middle" class="num">4</text>
54
+ <text x="974" y="156" class="step">它拿得出做完的证据</text>
55
+ <rect x="938" y="184" width="188" height="46" rx="10" fill="#172643"/>
56
+ <text x="954" y="204" class="body">回执 · 产物 · 可独立回读</text>
57
+ <text x="954" y="222" class="small">没有证据,就不说「做完了」</text>
58
+ </g>
59
+ <rect x="74" y="248" width="206" height="40" rx="12" fill="#17314b" stroke="#275779"/>
60
+ <text x="90" y="273" class="bubble">「@发布助手 3.2 能发了吗」</text>
61
+ <rect x="362" y="248" width="206" height="40" rx="12" fill="#1c2a4d" stroke="#3a4f7a"/>
62
+ <text x="378" y="273" class="small" fill="#cbd5e1">授权范围外的人和群,不响应</text>
63
+ <rect x="650" y="248" width="206" height="40" rx="12" fill="#1c2a4d" stroke="#3a4f7a"/>
64
+ <text x="666" y="273" class="small" fill="#cbd5e1">回复目标只能来自这条消息</text>
65
+ <rect x="938" y="248" width="188" height="40" rx="12" fill="#14322a" stroke="#2f6b52"/>
66
+ <circle cx="958" cy="268" r="6" fill="#4ade80"/>
67
+ <text x="972" y="273" class="small" fill="#cbd5e1">回读通过才算完成</text>
68
+ <path d="M302 210H330" stroke="url(#accent)" stroke-width="3" stroke-linecap="round"/>
69
+ <path d="m320 202 10 8-10 8" fill="none" stroke="#7777ff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
70
+ <path d="M590 210H618" stroke="url(#accent)" stroke-width="3" stroke-linecap="round"/>
71
+ <path d="m608 202 10 8-10 8" fill="none" stroke="#7777ff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
72
+ <path d="M878 210H906" stroke="url(#accent)" stroke-width="3" stroke-linecap="round"/>
73
+ <path d="m896 202 10 8-10 8" fill="none" stroke="#7777ff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
74
+ <rect x="52" y="336" width="1096" height="1" fill="#23304a"/>
75
+ <text x="52" y="370" class="body">和真人同事走同一套协作界面——区别是,它的身份、边界和每一次副作用都可以被审计。</text>
76
+ <text x="52" y="398" class="small">未 @ 的群消息默认沉默 · 命令行不提供「发给谁」这个参数 · 说「完成」必须有宿主签发的证据——这三条由合同评测锁定。</text>
77
+ </svg>
@@ -4,41 +4,158 @@
4
4
  "title": "dingtalk-agent Multica Workspace Run Report",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["$schema", "passed", "runId", "workspace", "provider", "profile", "workspaceId", "runtimeId", "agentId", "promptHash", "issueId", "issueStatus", "taskId", "taskStatus", "taskDiagnostic", "pollAttempts", "pollIntervalMs", "answer", "answerHash", "toolNames", "loadedSkills", "failures", "calls", "evidencePath", "remoteRead", "remoteWrite", "triggerWrite", "sideEffect", "dingtalkSideEffect"],
7
+ "required": [
8
+ "$schema",
9
+ "passed",
10
+ "runId",
11
+ "workspace",
12
+ "provider",
13
+ "profile",
14
+ "workspaceId",
15
+ "runtimeId",
16
+ "agentId",
17
+ "promptHash",
18
+ "issueId",
19
+ "issueStatus",
20
+ "taskId",
21
+ "taskStatus",
22
+ "taskDiagnostic",
23
+ "pollAttempts",
24
+ "pollIntervalMs",
25
+ "answer",
26
+ "answerHash",
27
+ "toolNames",
28
+ "loadedSkills",
29
+ "failures",
30
+ "calls",
31
+ "evidencePath",
32
+ "remoteRead",
33
+ "remoteWrite",
34
+ "triggerWrite",
35
+ "sideEffect",
36
+ "dingtalkSideEffect"
37
+ ],
8
38
  "properties": {
9
- "$schema": { "const": "dingtalk-agent/multica-workspace-run@1" },
10
- "passed": { "type": "boolean" },
11
- "runId": { "$ref": "#/$defs/id" },
12
- "workspace": { "$ref": "#/$defs/name" },
13
- "provider": { "const": "multica" },
14
- "profile": { "type": "string", "minLength": 1 },
15
- "workspaceId": { "type": "string", "minLength": 1 },
16
- "runtimeId": { "type": "string", "minLength": 1 },
17
- "agentId": { "type": "string", "minLength": 1 },
18
- "promptHash": { "$ref": "#/$defs/hash" },
19
- "issueId": { "type": "string", "minLength": 1 },
20
- "issueStatus": { "type": "string" },
21
- "taskId": { "type": "string" },
22
- "taskStatus": { "type": "string", "minLength": 1 },
23
- "taskDiagnostic": { "type": "string" },
24
- "pollAttempts": { "type": "integer", "minimum": 1 },
25
- "pollIntervalMs": { "type": "integer", "minimum": 100 },
26
- "answer": { "type": "string" },
27
- "answerHash": { "$ref": "#/$defs/hash" },
28
- "toolNames": { "type": "array", "items": { "type": "string", "minLength": 1 } },
29
- "loadedSkills": { "type": "array", "items": { "$ref": "#/$defs/name" } },
30
- "failures": { "type": "array", "items": { "type": "string", "minLength": 1 } },
31
- "calls": { "$ref": "multica-deployment-operation.schema.json#/$defs/calls" },
32
- "evidencePath": { "type": "string", "minLength": 1 },
33
- "remoteRead": { "const": true },
34
- "remoteWrite": { "const": true },
35
- "triggerWrite": { "const": false },
36
- "sideEffect": { "const": "multica-issue-read-write" },
37
- "dingtalkSideEffect": { "const": false }
39
+ "$schema": {
40
+ "const": "dingtalk-agent/multica-workspace-run@1"
41
+ },
42
+ "passed": {
43
+ "type": "boolean"
44
+ },
45
+ "runId": {
46
+ "$ref": "#/$defs/id"
47
+ },
48
+ "workspace": {
49
+ "$ref": "#/$defs/name"
50
+ },
51
+ "provider": {
52
+ "const": "multica"
53
+ },
54
+ "profile": {
55
+ "type": "string",
56
+ "minLength": 1
57
+ },
58
+ "workspaceId": {
59
+ "type": "string",
60
+ "minLength": 1
61
+ },
62
+ "runtimeId": {
63
+ "type": "string",
64
+ "minLength": 1
65
+ },
66
+ "agentId": {
67
+ "type": "string",
68
+ "minLength": 1
69
+ },
70
+ "promptHash": {
71
+ "$ref": "#/$defs/hash"
72
+ },
73
+ "issueId": {
74
+ "type": "string",
75
+ "minLength": 1
76
+ },
77
+ "issueStatus": {
78
+ "type": "string"
79
+ },
80
+ "taskId": {
81
+ "type": "string"
82
+ },
83
+ "taskStatus": {
84
+ "type": "string",
85
+ "minLength": 1
86
+ },
87
+ "taskDiagnostic": {
88
+ "type": "string"
89
+ },
90
+ "pollAttempts": {
91
+ "type": "integer",
92
+ "minimum": 1
93
+ },
94
+ "pollIntervalMs": {
95
+ "type": "integer",
96
+ "minimum": 100
97
+ },
98
+ "answer": {
99
+ "type": "string"
100
+ },
101
+ "answerHash": {
102
+ "$ref": "#/$defs/hash"
103
+ },
104
+ "toolNames": {
105
+ "type": "array",
106
+ "items": {
107
+ "type": "string",
108
+ "minLength": 1
109
+ }
110
+ },
111
+ "loadedSkills": {
112
+ "type": "array",
113
+ "items": {
114
+ "$ref": "#/$defs/name"
115
+ }
116
+ },
117
+ "failures": {
118
+ "type": "array",
119
+ "items": {
120
+ "type": "string",
121
+ "minLength": 1
122
+ }
123
+ },
124
+ "calls": {
125
+ "$ref": "multica-deployment-operation.schema.json#/$defs/calls"
126
+ },
127
+ "evidencePath": {
128
+ "type": "string",
129
+ "minLength": 1
130
+ },
131
+ "remoteRead": {
132
+ "const": true
133
+ },
134
+ "remoteWrite": {
135
+ "type": "boolean"
136
+ },
137
+ "triggerWrite": {
138
+ "const": false
139
+ },
140
+ "sideEffect": {
141
+ "const": "multica-issue-read-write"
142
+ },
143
+ "dingtalkSideEffect": {
144
+ "const": false
145
+ }
38
146
  },
39
147
  "$defs": {
40
- "id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{1,127}$" },
41
- "name": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$" },
42
- "hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
148
+ "id": {
149
+ "type": "string",
150
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{1,127}$"
151
+ },
152
+ "name": {
153
+ "type": "string",
154
+ "pattern": "^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$"
155
+ },
156
+ "hash": {
157
+ "type": "string",
158
+ "pattern": "^[a-f0-9]{64}$"
159
+ }
43
160
  }
44
161
  }
@@ -32,6 +32,11 @@
32
32
  }
33
33
  }
34
34
  },
35
+ "schedules": {
36
+ "type": "array",
37
+ "description": "Agent 内化的常驻节律(internalized cron),声明式、版本化。clock 只开窗,作用域/完成判据由 Skill 状态驱动。部署由 provider adapter 映射(Multica→autopilot)。见 dingtalk-agent-compose/references/drive-and-schedules.md",
38
+ "items": { "$ref": "#/$defs/schedule" }
39
+ },
35
40
  "workspaces": {
36
41
  "type": "object",
37
42
  "propertyNames": {
@@ -44,6 +49,23 @@
44
49
  }
45
50
  },
46
51
  "$defs": {
52
+ "schedule": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": ["name", "cron", "timezone", "mode"],
56
+ "properties": {
57
+ "name": { "type": "string", "minLength": 1, "maxLength": 128, "description": "人类标签,也作平台侧标题;同一 Project 内唯一" },
58
+ "cron": { "type": "string", "pattern": "^\\s*\\S+\\s+\\S+\\s+\\S+\\s+\\S+\\s+\\S+\\s*$", "description": "标准 5 段 cron(分 时 日 月 周),无秒、无 @macro" },
59
+ "timezone": { "type": "string", "minLength": 1, "description": "IANA 时区,如 Asia/Shanghai" },
60
+ "mode": { "enum": ["ephemeral", "work-item"], "description": "ephemeral=run-only;work-item=每次触发产生一个工作项(Multica create_issue)" },
61
+ "wake": { "type": "string", "minLength": 1, "description": "① 唤醒词/类别;Agent 读它给本拍定作用域,clock 不带工作清单" },
62
+ "purpose": { "type": "string", "minLength": 1 },
63
+ "completion": { "type": "string", "minLength": 1, "description": "② 从数据推得出的完成判据(level-triggered),不是「那一拍跑了没」" },
64
+ "unit": { "type": "string", "minLength": 1, "description": "③ 每次触发的增量工作单元(折 delta,不重建)" },
65
+ "evidence": { "type": "string", "minLength": 1, "description": "④ 什么效果证明真做了(write/receipt/水位),不认自述" },
66
+ "supervision": { "type": "string", "minLength": 1, "description": "⑤ 谁盯这个循环收敛" }
67
+ }
68
+ },
47
69
  "name": {
48
70
  "type": "string",
49
71
  "pattern": "^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$"
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/D1-2004/dingtalk-agent/docs/schemas/workspace-scaffold.schema.json",
4
+ "title": "dingtalk-agent Workspace Scaffold Result",
5
+ "description": "Result of `dta workspace create <name>` when it authors a managed-platform Workspace entry into dingtalk-agent.json (rather than building a local OpenCode host). Env-referenced IDs are namespaced by Workspace name; authority is filled in and agentIdFrom is deliberately omitted so the first deploy creates the Agent and saves its stable ID.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "$schema", "workspace", "provider", "stage", "profile", "applied", "alreadyDeclared",
10
+ "manifest", "block", "envRefs", "nextSteps", "sideEffect", "dingtalkSideEffect"
11
+ ],
12
+ "properties": {
13
+ "$schema": { "const": "dingtalk-agent/workspace-scaffold@1" },
14
+ "workspace": { "type": "string", "minLength": 1 },
15
+ "provider": { "const": "multica" },
16
+ "stage": { "enum": ["dev", "test", "staging", "prod"] },
17
+ "profile": { "type": "string", "minLength": 1 },
18
+ "applied": { "type": "boolean" },
19
+ "alreadyDeclared": { "type": "boolean" },
20
+ "manifest": { "const": "dingtalk-agent.json" },
21
+ "block": { "type": "object" },
22
+ "envRefs": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["workspaceId", "runtimeId", "dwsProfile", "expectedUserId"],
26
+ "properties": {
27
+ "workspaceId": { "type": "string", "minLength": 1 },
28
+ "runtimeId": { "type": "string", "minLength": 1 },
29
+ "dwsProfile": { "type": "string", "minLength": 1 },
30
+ "expectedUserId": { "type": "string", "minLength": 1 }
31
+ }
32
+ },
33
+ "nextSteps": { "type": "array", "items": { "type": "string" } },
34
+ "sideEffect": { "enum": ["local-manifest", false] },
35
+ "dingtalkSideEffect": { "const": false }
36
+ }
37
+ }
@@ -42,4 +42,4 @@ dta init && dta bootstrap --bindings agent.bindings.json --json
42
42
 
43
43
  ## 不包含
44
44
 
45
- Webhook、定时器、personal-event listener 等触发端都不在这里——[触发器不属于本项目](../../docs/ARCHITECTURE.md#3-一个-agent-依赖什么模型-b)。
45
+ Webhook、定时器、personal-event listener 等触发端都不在这里——[触发器不属于本项目](../../docs/ARCHITECTURE.md#3-每件事谁说了算模型-b)。
@@ -223,7 +223,19 @@ const makeIssueRun = (issueId, agentId, description) => {
223
223
  const resultMode = process.env.DTA_FAKE_MULTICA_SMOKE_RESULT_FILE || ''
224
224
  const resultName = resultMode === 'json-force' ? 'result.json' : 'result.md'
225
225
  const resultPath = `/home/user/multica_workspaces/ws-contract-deploy/${taskId}/workdir/${resultName}`
226
- const responseTools = resultMode
226
+ // `md-bare` 复刻线上实测写法:write 用绝对路径,随后的 comment add / rm 用**裸文件名**
227
+ // 引用同一个 workdir 文件(2026-07-22 fde-prod smoke task e3490d24 实测轨迹)。
228
+ const responseTools = resultMode === 'md-bare'
229
+ ? [
230
+ { type: 'tool_use', tool: 'write', input: { filePath: resultPath, content: reply } },
231
+ { type: 'tool_use', tool: 'bash', input: {
232
+ command: `multica issue comment add ${issueId} --content-file ${resultName}`,
233
+ } },
234
+ { type: 'tool_use', tool: 'bash', input: {
235
+ command: `multica issue status ${issueId} in_review && rm ${resultName}`,
236
+ } },
237
+ ]
238
+ : resultMode
227
239
  ? [
228
240
  { type: 'tool_use', tool: 'write', input: { filePath: resultPath, content: reply } },
229
241
  { type: 'tool_use', tool: 'bash', input: {
@@ -299,7 +311,11 @@ if (commandKey === 'issue runs') {
299
311
  requireScope()
300
312
  const issue = state.issues.find((item) => item.id === core[2])
301
313
  if (!issue) process.exit(94)
302
- finish(issue.runs.map(({ messages, ...run }) => run))
314
+ // Simulate an overrunning run: report the task as still running so the poll loop times out.
315
+ // The persisted run stays terminal, so a later `--status --run-id` resume sees it completed.
316
+ const forceRunning = process.env.DTA_FAKE_MULTICA_RUN_FORCE_RUNNING === '1'
317
+ finish(issue.runs.map(({ messages, ...run }) =>
318
+ forceRunning ? { ...run, status: 'running' } : run))
303
319
  }
304
320
  if (commandKey === 'issue run-messages') {
305
321
  requireScope()
@@ -54,7 +54,7 @@
54
54
  }
55
55
  ],
56
56
  "sourceRefs": [
57
- "docs/ARCHITECTURE.md#8-从定义到上线",
57
+ "docs/ARCHITECTURE.md#8-开发生命周期从定义到观测",
58
58
  "skills/core/dingtalk-agent-eval/references/evidence-contract.md"
59
59
  ],
60
60
  "manualChecks": [
@@ -12,7 +12,7 @@
12
12
  "capability": "basic-skill",
13
13
  "prompt": "这是基础行为加载探针。只依据已经进入当前上下文的正文,严格输出 skill=<name>@<metadata.version>;如果正文不可见,只输出 skill=not-loaded。禁止猜测,不要补充解释。",
14
14
  "expectations": [
15
- { "id": "exact-basic-version", "type": "equals", "value": "skill=dingtalk-basic-behavior@0.11.11" }
15
+ { "id": "exact-basic-version", "type": "equals", "value": "skill=dingtalk-basic-behavior@0.12.0" }
16
16
  ],
17
17
  "manualChecks": []
18
18
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xdxer/dingtalk-agent",
3
- "version": "0.1.5-beta.3",
4
- "description": "钉钉数字员工的 Skill-first 行为范式:全局 Skill 决策,CLI 固定事务边界,Workspace 按需。",
3
+ "version": "0.1.5-beta.4",
4
+ "description": " Agent 装配成钉钉数字员工:Skill 决策,CLI 固定事务边界,Agent 本体运行在哪个 Managed Agent Platform 上是可替换的。",
5
5
  "keywords": [
6
6
  "dingtalk",
7
7
  "agent",
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: dingtalk-agent-compose
3
- description: 当用户要创建、新建、装配一个 Agent 或钉钉数字员工——包括把 GitHub 仓库、本地文件夹或钉钉文档定义成 Agent,或要审计、补齐、优化 Agent 的 AGENTS.md、本体职责、岗位 Skills、记忆/知识/产物存储与 DWS 权限绑定时使用。即使尚未 init Workspace,也按 dingtalk-agent 的 AgentDefinition 范式给出可运行的最小装配方案;不负责事件触发器。
3
+ description: 当用户要创建、新建、装配一个 Agent 或钉钉数字员工——包括把 GitHub 仓库、本地文件夹或钉钉文档定义成 Agent,或要审计、补齐、优化 Agent 的 AGENTS.md、本体职责、岗位 Skills、记忆/知识/产物存储、DWS 权限绑定与「谁叫醒它」的驱动节律时使用。即使尚未 init Workspace,也按 dingtalk-agent 的 AgentDefinition 范式给出可运行的最小装配方案;声明驱动节律但不实现触发器本身。
4
4
  compatibility: Requires dingtalk-agent on PATH; remote DingTalk documents require authenticated dws.
5
5
  metadata:
6
- version: "0.13.1"
6
+ version: "0.14.0"
7
7
  ---
8
8
 
9
9
  # 装配一个可工作的钉钉数字员工 Agent
@@ -20,7 +20,8 @@ metadata:
20
20
  6. 审核本体:优先使用 `agent/AGENTS.md` 精简表达四块长期语义——定义、不能做的底线、做事标准范式、常犯错误。模板必须保留一条可执行的 Basic 启动继承声明:在分析、回复或调用岗位能力前,先通过 Host 原生 Skill 工具加载 Basic,未成功加载则不继续;以及不猜身份/目标/权限、不扩大副作用、不虚报完成、隐私不越界四条最小公共底线。完整协议仍只在 Basic Skill。CLI 只补骨架,绝不虚构岗位语义;只要 Agent Definition 或 Role Skill 仍含模板 `<...>`,`agent audit` 必须保持 `partial`。
21
21
  7. 审核能力:Basic Behavior 是所有钉钉员工共享且**每个 Session 必须加载**的协议;岗位知识和流程拆到独立 Role/Workflow Skill。目录可发现不等于正文已加载,必须为目标 Agent Host 生成可验证的加载合同。不要把 FDE、招聘、事故处理等岗位方法写回 Basic Skill。
22
22
  8. 审核存储:明确工作记忆、业务事实、长期知识、产物和宿主私有控制状态分别去哪。介质可以换,语义层与控制状态不能混。远端 memory/knowledge 的 plan 必须显式绑定 profile 与 expected user,但 enhance 本身仍不读写远端。
23
- 9. 运行 `dta bootstrap --bindings agent.bindings.json --json` `dta agent audit --bindings agent.bindings.json --require-skill <role> --json`。静态配置和真实语义通过后再加 `--verify-load --yes`;不能把“写出了文件”或“目录存在”当成装配完成。
23
+ 9. **审核驱动:这个员工由谁叫醒。** 只会被 @ 唤醒的 Agent 不是同事,是查询接口——巡检、补数据、到点交付都发生在没人说话的时候。把每件周期性的事分成三类(人在钉钉设的时间点 / 岗位的常驻节律 / Agent 自主定时),为每条节律写清节律、作用域、完成判据、失败可见性,并交由目标平台校验能力。**dta 声明节律但不创建触发器**;`dta deploy` 不会创建也不会修改任何 schedule。完整判据、三条与平台无关的硬约束(定时不可靠是常态、外发类节律没有锁、Agent 不自建定时器)和装配自检清单见 [drive-and-schedules.md](references/drive-and-schedules.md);具体平台提供什么能力以该平台 `PLATFORM.md` 为准,**平台之间能力不同是常态**,不支持就记为缺口,不静默降级成“那就不定时了”。
24
+ 10. 运行 `dta bootstrap --bindings agent.bindings.json --json` 和 `dta agent audit --bindings agent.bindings.json --require-skill <role> --json`。静态配置和真实语义通过后再加 `--verify-load --yes`;不能把“写出了文件”或“目录存在”当成装配完成。
24
25
 
25
26
  ## 本体、Skill 与 Gate 怎么分
26
27
 
@@ -1,6 +1,6 @@
1
1
  # <Agent 名称>
2
2
 
3
- > 在分析、回复或调用任何岗位能力前,必须先通过 Host 原生 Skill 工具加载 `dingtalk-basic-behavior`;没有本次任务的成功加载证据时不继续。随后再按需加载 Role Skills:<Role Skill names>。本文件只定义角色差异,不扩大宿主、Skill 或工具授予的权限。
3
+ > 在分析、回复或调用任何岗位能力前,必须先通过 Host 原生 Skill 工具加载 `dingtalk-basic-behavior`;没有本次任务的成功加载证据时不继续。随后再按需加载 Role Skills:<Role Skill names>。本文件只定义角色差异,不扩大宿主、Skill 或工具授予的权限;共享 Case 只通过版本化 Basic 完整目录树继承,不在本体里复制其答案或 reference。
4
4
 
5
5
  ## 定义
6
6