@xdxer/dingtalk-agent 0.1.4-beta.10 → 0.1.4-beta.11

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 CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes to `@xdxer/dingtalk-agent` are documented here. The project follows semantic versioning; prerelease entries describe release candidates and do not imply that Live canaries or registry publication have completed.
4
4
 
5
+ ## 0.1.4-beta.11 - 2026-07-19
6
+
7
+ ### Added
8
+
9
+ - A managed agent platform abstraction: `dta agent-platform list|show|use` with a fixed resolution order (`DTA_AGENT_PLATFORM` env > `dingtalk-agent.json#agentPlatform` > `.dingtalk-agent/agent-platform.json` > inference from declared Multica providers). `multica-dingtalk` is supported; `deap` is registered as coming-soon and fails closed everywhere.
10
+ - Platform skill packs load lazily: selecting `multica-dingtalk` installs `dingtalk-agent-deploy` and `dingtalk-agent-boot-multica`; they are no longer implied by the default install. Platform-specific methodology ships in these packs, not in the CLI.
11
+ - `deploy`, `promote`, and `observe` now pass a fail-closed platform-membership gate; missing, unknown, or coming-soon platforms are rejected with guidance.
12
+ - Contract case 61 covers the registry, the gate, the coming-soon rejection, membership writing, and lazy skill installation; `agent-platform@1` schema added and `project@1` gains the optional `agentPlatform` field.
13
+
14
+ ### Changed
15
+
16
+ - `dta skill install|status|upgrade|uninstall` without a name now operate on all default bundled Skills (basic-behavior + compose) with a `skill-status-suite@1` JSON envelope; an explicit name keeps the single-skill contract. `setup` installs the full default suite and `doctor` aggregates per-client discovery across it.
17
+ - The compose Skill (0.5.1) names 创建/新建/装配 Agent triggers and drops its placeholder wording, so "帮我创建一个 Agent" reaches it on OpenCode and other hosts.
18
+ - Isolated-HOME eval and release environments strip host `CLAUDE_*` variables so the upstream skills CLI cannot escape the sandbox into the real Claude config directory.
19
+ - Unknown-command suggestions now include `lab`, `listen`, `deploy`, `promote`, `observe`, and `agent-platform`.
20
+
21
+ ### Release boundary
22
+
23
+ - Distribution is limited to the public npm `beta` dist-tag, a Git tag, and a GitHub pre-release. No robot, webhook, schedule, Trigger, or DingTalk/Multica side effect is created. The Live waivers recorded for beta.9 remain unchanged.
24
+
5
25
  ## 0.1.4-beta.10 - 2026-07-19
6
26
 
7
27
  ### Removed
package/README.en.md CHANGED
@@ -46,7 +46,7 @@ DWS is enough for occasional manual API operations. A digital employee that work
46
46
 
47
47
  The boundary is: **Skills advise, the CLI enforces, and DWS executes.** Semantic judgment remains in Skills; invariants belong in code; DingTalk product operations stay in DWS.
48
48
 
49
- > `0.1.4-beta.9` is published on the public npm `beta` dist-tag with a matching Git tag and GitHub pre-release. It includes the Basic 0.10.0/0.9.4 model regression, host-issued Completion Evidence, remote semantic-state cold-start and Live-ready runners, the developer Golden Path, safe enhancement of existing Agent repositories, Provider-bound Workspace W1–W5, Completion-grader hardening, a Phase 9 personal-event Live-ready runner, and isolated installation acceptance, with 60 deterministic contracts. Phase 8's recorded sample passed the safety and artifact gates that existed at the time, but did not prove a stable model-quality gain for 0.10.0. Phase 15 adds fail-closed contradictory-claim detection and a predeclared effectiveness policy without rewriting historical scores. Real personal-event, remote-state, and Multica Live were explicitly waived as release gates for this beta; local and fake-Provider evidence is not relabeled as real platform proof, and no Trigger or DingTalk/Multica side effect was created.
49
+ > `0.1.4-beta.11` is being released (npm `beta` dist-tag, Git tag, GitHub pre-release). beta.10 removed legacy dead code and aligned the entry docs; beta.11 installs all bundled Skills by default, fixes the compose Skill trigger, and introduces the managed agent platform abstraction (multica-dingtalk supported, deap coming soon; deploy/promote/observe require platform membership, and platform skill packs install on selection). The earlier beta.9 line includes the Basic 0.10.0/0.9.4 model regression, host-issued Completion Evidence, remote semantic-state cold-start and Live-ready runners, the developer Golden Path, safe enhancement of existing Agent repositories, Provider-bound Workspace W1–W5, Completion-grader hardening, a Phase 9 personal-event Live-ready runner, and isolated installation acceptance, the contract suite now covers 61 deterministic scenarios. Phase 8's recorded sample passed the safety and artifact gates that existed at the time, but did not prove a stable model-quality gain for 0.10.0. Phase 15 adds fail-closed contradictory-claim detection and a predeclared effectiveness policy without rewriting historical scores. Real personal-event, remote-state, and Multica Live were explicitly waived as release gates for this beta; local and fake-Provider evidence is not relabeled as real platform proof, and no Trigger or DingTalk/Multica side effect was created.
50
50
 
51
51
  ## Quick start
52
52
 
@@ -61,7 +61,7 @@ dta --version
61
61
  dta doctor
62
62
  ```
63
63
 
64
- `setup` checks Node.js, DWS version and authentication, installs and verifies the Basic Behavior Skill, and reports whether Claude Code, Codex, and OpenCode can discover it. `listen` is an optional development adapter, not the mandatory Agent entry point.
64
+ `setup` checks Node.js, DWS version and authentication, installs and verifies the bundled Skills (Basic Behavior + Compose), and reports whether Claude Code, Codex, and OpenCode can discover it. `listen` is an optional development adapter, not the mandatory Agent entry point.
65
65
 
66
66
  For a source release candidate, run the deterministic tarball acceptance:
67
67
 
package/README.md CHANGED
@@ -48,7 +48,7 @@ Claude Code、Codex 或其他 Agent Host 都能使用这套内核;触发 Adapt
48
48
 
49
49
  本项目把这些约束从巨型 Prompt 中拆出来:**Skill 劝,CLI 拦,DWS 做。** 必须成立的规则进入代码;需要语义判断的行为留在 Skill;具体钉钉产品能力继续由 DWS 执行。
50
50
 
51
- > `0.1.4-beta.9` 已发布到公共 npm `beta` dist-tag,并创建对应 Git Tag 与 GitHub Pre-release。该版本完成 Basic 0.10.0/0.9.4 模型回归、宿主签发 Completion Evidence、远端语义状态冷启动与 Live-ready runner、开发者 Golden Path、已有仓库安全 enhance、Provider-bound Workspace W1–W5、Completion grader 加固、Phase 9 personal-event Live-ready runner 与隔离安装验收,共有 60 个确定性合同。Phase 8 的已记录样本通过当时的安全和产物硬门禁,但未证明 0.10.0 有稳定模型增益;Phase 15 又把矛盾完成声明和增益判定收紧为显式 fail-closed 策略,且不重写历史分数。本次 beta 明确豁免真实 personal-event、远端状态与 Multica Live 作为发布门禁,不把本地或 fake-Provider 证据冒充真实平台通过,也没有创建 Trigger 或钉钉/Multica 副作用。
51
+ > `0.1.4-beta.11` 已进入发布流程(npm `beta` dist-tagGit Tag 与 GitHub Pre-release)。beta.10 移除上一代遗留死代码并对齐入口文档;beta.11 默认安装全部内置 Skill(基础行为 + 装配)、修复装配 Skill 的触发描述,并引入 managed agent platform 归属抽象(已支持 multica-dingtalk,deap 敬请期待;deploy/promote/observe 需先归属,平台技能包按选择安装)。此前 beta.9 完成 Basic 0.10.0/0.9.4 模型回归、宿主签发 Completion Evidence、远端语义状态冷启动与 Live-ready runner、开发者 Golden Path、已有仓库安全 enhance、Provider-bound Workspace W1–W5、Completion grader 加固、Phase 9 personal-event Live-ready runner 与隔离安装验收,合同评测现为 61 个确定性场景。Phase 8 的已记录样本通过当时的安全和产物硬门禁,但未证明 0.10.0 有稳定模型增益;Phase 15 又把矛盾完成声明和增益判定收紧为显式 fail-closed 策略,且不重写历史分数。本次 beta 明确豁免真实 personal-event、远端状态与 Multica Live 作为发布门禁,不把本地或 fake-Provider 证据冒充真实平台通过,也没有创建 Trigger 或钉钉/Multica 副作用。
52
52
 
53
53
  ## 两分钟开始
54
54
 
@@ -66,7 +66,7 @@ npm install --global --prefix "$HOME/.local" \
66
66
 
67
67
  1. 将 CLI 安装到用户目录 `~/.local/bin`,必要时幂等补充 shell PATH;
68
68
  2. 检查 Node.js、DWS 版本和 `dws auth status`;
69
- 3. 安装并验证 Basic Behavior Skill;
69
+ 3. 安装并验证内置 Skill(Basic Behavior 基础行为 + Compose 装配);
70
70
  4. 报告 Claude Code、Codex、OpenCode 是否能够发现 Skill。
71
71
 
72
72
  当前终端尚未加载新 PATH 时,setup 会打印一条可直接执行的 `export PATH=...`。验证结果:
@@ -242,7 +242,7 @@ Session 创建时冻结 Definition 与 Skill snapshot;在线 Run 可以提出
242
242
 
243
243
  无论消息来自机器人 connector、真实 personal-event,还是另一个标准化大脑/Agent Host,进入 dta 后都应归一成 Invocation。机器人渠道下也仍像同事一样回复;渠道只决定可获得的 envelope 和谁拥有外发权,不改变角色本体。
244
244
 
245
- ### 用仓库或文件夹定义 XXX Agent
245
+ ### 用仓库或文件夹定义钉钉数字员工 Agent
246
246
 
247
247
  最小可工作装配只有两组输入:
248
248
 
@@ -341,6 +341,8 @@ dta workspace status multica-dev --json
341
341
 
342
342
  回读证据只保存最小资源事实和原始输出 hash,不保存 Token、邮箱、Server URL 明文、Agent instructions/runtime config 或 Skill content。身份、默认 Workspace、scope、稳定 ID、Skill 唯一性或 evidence hash 任一不符都 fail closed;成功后 state 仍是 `verifying`,`readyForApply=true` 只表示可以进入 W4 规划。
343
343
 
344
+ 部署、晋级等平台命令先经过 managed agent platform 归属门禁。工作区用 `dta agent-platform use multica-dingtalk` 声明归属(写入 `dingtalk-agent.json#agentPlatform` 或 `.dingtalk-agent/agent-platform.json`,也可用 `DTA_AGENT_PLATFORM` 环境变量覆盖),声明时才按需安装该平台的技能包(deploy 与 boot-multica);`dta agent-platform list` 展示注册表——当前已支持 `multica-dingtalk`,`deap` 敬请期待。未归属、未知或 coming-soon 平台上的 `deploy`/`promote`/`observe` 一律 fail-closed;已声明 Multica Provider 的项目可被自动推断为 `multica-dingtalk`。后续所有平台相关的方法学都随对应平台的技能包分发,不进入 CLI 与基础行为。
345
+
344
346
  W4 用 `dta deploy` 把这份可信 inspection 变成 plan-bound apply。dry-run 固定 profile/workspace/runtime/Agent/Definition/Skill tree hash 和 forward/rollback 最大写预算,apply 前重新回读同一条 ID 链;只有显式 `--plan-id` 与 `--yes` 才会创建或更新。CLI 会精确同步受管 Boot、Basic、Role Skill 完整树和唯一 assignment,再通过专用 Issue 回读 Skill tool trace 与精确 JSON response;两个证据都通过才从 `verifying` 进入 `ready`:
345
347
 
346
348
  ```bash
@@ -38,7 +38,8 @@ import { upgradeAgent } from '../src/upgrade.js';
38
38
  import { checkpointTask, showTaskCheckpoint } from '../src/memory/task-checkpoints.js';
39
39
  import { upsertOperationalMemory } from '../src/memory/operational.js';
40
40
  import { proposeMemoryCandidate, publishMemoryCandidate, reviewMemoryCandidate, showMemoryCandidate, } from '../src/memory/candidates.js';
41
- import { installGlobalSkill, skillStatus, uninstallGlobalSkill, upgradeGlobalSkill, } from '../src/skill-manager.js';
41
+ import { installBundledSkills, installGlobalSkill, skillStatus, skillSuiteStatus, uninstallBundledSkills, uninstallGlobalSkill, upgradeBundledSkills, upgradeGlobalSkill, } from '../src/skill-manager.js';
42
+ import { MANAGED_AGENT_PLATFORMS, requireSupportedAgentPlatform, resolveAgentPlatform, statusLabel as platformStatusLabel, useAgentPlatform, } from '../src/agent-platform.js';
42
43
  const PACKAGE_ROOT = resolvePackageRoot(import.meta.url);
43
44
  const PACKAGE_JSON = JSON.parse(readFileSync(join(PACKAGE_ROOT, 'package.json'), 'utf8'));
44
45
  // ROOT = **你的工作区**(当前目录),不是包所在的目录。
@@ -56,16 +57,16 @@ dta —— 给 Agent 安装钉钉员工的基础行为和工作环境
56
57
  · 从本地目录或钉钉文档加载身份、记忆和知识
57
58
 
58
59
  开始使用:
59
- dta setup 首次配置 CLI、DWS 和基础行为 Skill
60
+ dta setup 首次配置 CLI、DWS 和内置 Skill(基础行为 + Agent 装配)
60
61
  dta bootstrap --json 为当前 Agent 会话加载工作区
61
62
  dta agent enhance / audit 安全增强已有仓库,再审计定义、存储与 Skill 真加载
62
63
  dta info / dta workspace doctor <name> 查看 Project 并只读诊断 Workspace
63
- dta deploy ... / dta promote ... 预览 Multica 受控部署或已验版本晋级
64
+ dta agent-platform use <platform> → dta deploy / dta promote 声明平台归属并装平台技能包,再受控部署与晋级
64
65
 
65
66
  维护环境:
66
67
  dta doctor 检查哪里没装好,并给出修复提示
67
68
  dta upgrade 自升级,再重新检查完整环境
68
- dta skill status 查看 Claude Code、Codex、OpenCode 能否发现 Skill
69
+ dta skill status 查看 Claude Code、Codex、OpenCode 能否发现内置 Skill(可加 name 只查一个)
69
70
 
70
71
  接入钉钉事件和可靠外发:dta help runtime
71
72
  `;
@@ -232,6 +233,7 @@ async function main() {
232
233
  return;
233
234
  }
234
235
  if (cmd === 'deploy') {
236
+ requireSupportedAgentPlatform('deploy', PROJECT_START);
235
237
  const { values: o, positionals } = parseArgs({
236
238
  args: argv.slice(1), allowPositionals: true,
237
239
  options: {
@@ -307,6 +309,7 @@ async function main() {
307
309
  return;
308
310
  }
309
311
  if (cmd === 'promote') {
312
+ requireSupportedAgentPlatform('promote', PROJECT_START);
310
313
  const { values: o, positionals } = parseArgs({
311
314
  args: argv.slice(1), allowPositionals: true,
312
315
  options: {
@@ -366,6 +369,7 @@ async function main() {
366
369
  return;
367
370
  }
368
371
  if (cmd === 'observe') {
372
+ requireSupportedAgentPlatform('observe', PROJECT_START);
369
373
  const { values: o, positionals } = parseArgs({
370
374
  args: argv.slice(1), allowPositionals: true,
371
375
  options: {
@@ -680,24 +684,89 @@ async function main() {
680
684
  });
681
685
  if (positionals.length > 1)
682
686
  fail('skill 最多接受一个 Skill name');
683
- const options = { dryRun: o['dry-run'], name: o.name || positionals[0] };
687
+ const name = o.name || positionals[0];
688
+ const dryRun = Boolean(o['dry-run']);
684
689
  let out;
685
- if (sub === 'install')
686
- out = installGlobalSkill(PACKAGE_ROOT, options);
687
- else if (sub === 'status')
688
- out = skillStatus(PACKAGE_ROOT, options);
689
- else if (sub === 'upgrade')
690
- out = upgradeGlobalSkill(PACKAGE_ROOT, options);
691
- else if (sub === 'uninstall')
692
- out = uninstallGlobalSkill(PACKAGE_ROOT, options);
693
- else
690
+ if (sub === 'install') {
691
+ out = name
692
+ ? installGlobalSkill(PACKAGE_ROOT, { dryRun, name })
693
+ : installBundledSkills(PACKAGE_ROOT, { dryRun });
694
+ }
695
+ else if (sub === 'status') {
696
+ out = name ? skillStatus(PACKAGE_ROOT, { dryRun, name }) : skillSuiteStatus(PACKAGE_ROOT, { dryRun });
697
+ }
698
+ else if (sub === 'upgrade') {
699
+ out = name
700
+ ? upgradeGlobalSkill(PACKAGE_ROOT, { dryRun, name })
701
+ : upgradeBundledSkills(PACKAGE_ROOT, { dryRun });
702
+ }
703
+ else if (sub === 'uninstall') {
704
+ out = name
705
+ ? uninstallGlobalSkill(PACKAGE_ROOT, { dryRun, name })
706
+ : uninstallBundledSkills(PACKAGE_ROOT, { dryRun });
707
+ }
708
+ else {
694
709
  fail(`不认识的 skill 子命令: ${sub || '(缺失)'}`, 1, `可用命令: dta skill install | status | upgrade | uninstall${suggest(sub || '', ['install', 'status', 'upgrade', 'uninstall'], 'dta skill')}`);
710
+ }
695
711
  if (o.json)
696
712
  console.log(JSON.stringify(out, null, 2));
713
+ else if ('skills' in out)
714
+ for (const item of out.skills)
715
+ printSkillStatus(item, sub, dryRun);
697
716
  else
698
- printSkillStatus(out, sub, Boolean(o['dry-run']));
717
+ printSkillStatus(out, sub, dryRun);
699
718
  return;
700
719
  }
720
+ // ── agent-platform:工作区归属的 managed agent platform;平台工具包按选择惰性安装。──
721
+ if (cmd === 'agent-platform') {
722
+ const { values: o, positionals } = parseArgs({
723
+ args: argv.slice(2),
724
+ allowPositionals: true,
725
+ options: { json: { type: 'boolean' }, 'no-install': { type: 'boolean' } },
726
+ });
727
+ if (sub === 'list') {
728
+ if (positionals.length)
729
+ fail('agent-platform list 不接受位置参数');
730
+ const out = { $schema: 'dingtalk-agent/agent-platform-list@1', platforms: MANAGED_AGENT_PLATFORMS };
731
+ if (o.json)
732
+ console.log(JSON.stringify(out, null, 2));
733
+ else
734
+ for (const platform of MANAGED_AGENT_PLATFORMS)
735
+ printAgentPlatform(platform);
736
+ return;
737
+ }
738
+ if (sub === 'show') {
739
+ if (positionals.length)
740
+ fail('agent-platform show 不接受位置参数');
741
+ const out = resolveAgentPlatform(PROJECT_START);
742
+ if (o.json)
743
+ console.log(JSON.stringify(out, null, 2));
744
+ else
745
+ printAgentPlatformResolution(out);
746
+ return;
747
+ }
748
+ if (sub === 'use') {
749
+ if (positionals.length !== 1)
750
+ fail('agent-platform use 需要且只接受一个 platform name');
751
+ const out = useAgentPlatform(PROJECT_START, positionals[0], {
752
+ packageRoot: PACKAGE_ROOT, installSkills: !o['no-install'],
753
+ });
754
+ if (o.json)
755
+ console.log(JSON.stringify(out, null, 2));
756
+ else {
757
+ console.log(`✅ 工作区已归属 ${out.definition?.label}(写入 ${out.written})`);
758
+ for (const install of out.skillInstalls)
759
+ printSkillStatus(install, 'install', false);
760
+ if (!out.skillInstalls.length) {
761
+ console.log(out.definition?.skills.length
762
+ ? ` 已跳过平台技能包安装(--no-install):${out.definition.skills.join(', ')}`
763
+ : ' 该平台无需额外技能包。');
764
+ }
765
+ }
766
+ return;
767
+ }
768
+ fail(`不认识的 agent-platform 子命令: ${sub || '(缺失)'}`, 1, `可用命令: dta agent-platform list | show | use <platform>${suggest(sub || '', ['list', 'show', 'use'], 'dta agent-platform')}`);
769
+ }
701
770
  // ── bootstrap:当前 Agent Session 按需发现/拉取语义上下文。──
702
771
  if (cmd === 'bootstrap') {
703
772
  const { values: o } = parseArgs({
@@ -1241,7 +1310,8 @@ async function main() {
1241
1310
  return;
1242
1311
  }
1243
1312
  fail(`不认识的命令: ${cmd}`, 1, `运行 dta --help 查看全部命令${suggest(cmd, [
1244
- 'setup', 'upgrade', 'doctor', 'skill', 'bootstrap', 'init', 'prepare', 'run', 'dispatch', 'task', 'memory', 'act',
1313
+ 'setup', 'upgrade', 'doctor', 'skill', 'agent-platform', 'bootstrap', 'init', 'prepare', 'run', 'dispatch', 'task', 'memory', 'act',
1314
+ 'lab', 'listen', 'deploy', 'promote', 'observe',
1245
1315
  'agent',
1246
1316
  'info', 'workspace',
1247
1317
  ])}`);
@@ -1373,6 +1443,26 @@ function printAgentEnhance(out) {
1373
1443
  console.log(` backup=${out.backupRoot}`);
1374
1444
  console.log(` audit=${out.audit.status} missing=${out.audit.missing.join(', ') || '-'}`);
1375
1445
  }
1446
+ function printAgentPlatform(platform) {
1447
+ console.log(`${platform.status === 'supported' ? '✅' : '⏳'} ${platform.name} · ${platform.label} · ${platformStatusLabel(platform.status)}`);
1448
+ console.log(` ${platform.description}`);
1449
+ if (platform.skills.length)
1450
+ console.log(` 技能包: ${platform.skills.join(', ')}`);
1451
+ if (platform.commands.length)
1452
+ console.log(` 平台命令: ${platform.commands.map((item) => `dta ${item}`).join(' · ')}`);
1453
+ }
1454
+ function printAgentPlatformResolution(out) {
1455
+ if (!out.platform) {
1456
+ console.log('⚠️ 当前工作区未声明 managed agent platform');
1457
+ console.log(' 运行 `dta agent-platform use multica-dingtalk`,或设置 DTA_AGENT_PLATFORM 环境变量。');
1458
+ return;
1459
+ }
1460
+ const known = out.definition;
1461
+ console.log(`${known ? '✅' : '❌'} 当前 platform: ${out.platform}${known ? ` · ${known.label} · ${platformStatusLabel(known.status)}` : '(未知)'}`);
1462
+ console.log(` 来源: ${out.source}${out.file ? ` · ${out.file}` : ''}`);
1463
+ if (known?.skills.length)
1464
+ console.log(` 技能包: ${known.skills.join(', ')}`);
1465
+ }
1376
1466
  function printSkillStatus(out, action, dryRun) {
1377
1467
  const prefix = dryRun ? 'DRY-RUN' : '✅';
1378
1468
  const verb = action === 'status' ? '全局 Skill 状态' : `skill ${action}`;