@xdxer/dingtalk-agent 0.1.4-beta.9 → 0.1.5-beta.1
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 +229 -0
- package/README.en.md +89 -324
- package/README.md +88 -674
- package/dist/bin/dingtalk-agent.js +207 -21
- package/dist/bin/dingtalk-agent.js.map +1 -1
- package/dist/src/agent-audit.js +1014 -89
- package/dist/src/agent-audit.js.map +1 -1
- package/dist/src/agent-enhance.js +41 -8
- package/dist/src/agent-enhance.js.map +1 -1
- package/dist/src/agent-platform.js +299 -0
- package/dist/src/agent-platform.js.map +1 -0
- package/dist/src/config.js +1 -7
- package/dist/src/config.js.map +1 -1
- package/dist/src/development-workspace.js +31 -5
- package/dist/src/development-workspace.js.map +1 -1
- package/dist/src/doctor.js +74 -15
- package/dist/src/doctor.js.map +1 -1
- package/dist/src/host-detect.js +146 -0
- package/dist/src/host-detect.js.map +1 -0
- package/dist/src/instruction-path.js +270 -0
- package/dist/src/instruction-path.js.map +1 -0
- package/dist/src/multica-deploy.js +78 -20
- package/dist/src/multica-deploy.js.map +1 -1
- package/dist/src/multica-provider.js +1 -1
- package/dist/src/multica-provider.js.map +1 -1
- package/dist/src/opencode-evals.js +710 -225
- package/dist/src/opencode-evals.js.map +1 -1
- package/dist/src/opencode-isolation.js +124 -0
- package/dist/src/opencode-isolation.js.map +1 -0
- package/dist/src/opencode-provider.js +1 -0
- package/dist/src/opencode-provider.js.map +1 -1
- package/dist/src/opencode-workspace.js +21 -10
- package/dist/src/opencode-workspace.js.map +1 -1
- package/dist/src/remote-state-evals.js +2 -1
- package/dist/src/remote-state-evals.js.map +1 -1
- package/dist/src/robot-evals.js +2 -1
- package/dist/src/robot-evals.js.map +1 -1
- package/dist/src/setup.js +6 -5
- package/dist/src/setup.js.map +1 -1
- package/dist/src/skill-manager.js +141 -12
- package/dist/src/skill-manager.js.map +1 -1
- package/dist/src/skills.js +2 -1
- package/dist/src/skills.js.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/upgrade.js +23 -27
- package/dist/src/upgrade.js.map +1 -1
- package/dist/src/version.js +73 -0
- package/dist/src/version.js.map +1 -0
- package/docs/ARCHITECTURE.md +232 -0
- package/docs/INSTALLATION.md +3 -3
- package/docs/PRIOR-ART.md +122 -0
- package/docs/SELF-TEST.md +182 -0
- package/docs/assets/agent-delivery-lifecycle.svg +103 -0
- package/docs/schemas/agent-platform.schema.json +13 -0
- package/docs/schemas/project.schema.json +3 -0
- package/docs/schemas/release-readiness.schema.json +2 -1
- package/evals/README.md +17 -0
- package/examples/agents/README.md +43 -0
- package/examples/agents/fde-coach/AGENTS.md +26 -17
- package/examples/agents/release-manager/AGENTS.md +26 -17
- package/lab/README.md +3 -3
- package/lab/agent-eval/catalog.json +5 -5
- package/lab/agent-eval/classic-failures.json +9 -9
- package/lab/agent-eval/completion-gate-regression.json +6 -6
- package/lab/agent-eval/remote-state-workspace/opencode.json +1 -1
- package/lab/agent-eval/workspace/AGENTS.md +1 -1
- package/lab/project-workspace/fake-multica-provider.mjs +17 -6
- package/lab/project-workspace/opencode-provider-suite.json +2 -2
- package/lab/robot-eval/suite.json +1 -1
- package/lab/robot-eval/workspace/AGENTS.md +1 -1
- package/lab/schemas/agent-eval-catalog.schema.json +1 -1
- package/package.json +18 -13
- package/skills/README.md +23 -0
- package/skills/core/dingtalk-agent-compose/SKILL.md +151 -0
- package/skills/core/dingtalk-agent-compose/assets/AGENTS.template.md +35 -0
- package/skills/core/dingtalk-agent-compose/assets/role-skill.template.md +32 -0
- package/skills/core/dingtalk-agent-compose/evals/evals.json +129 -0
- package/skills/{dingtalk-agent-compose → core/dingtalk-agent-compose}/references/agent-definition-contract.md +3 -3
- package/skills/core/dingtalk-agent-compose/references/host-loading-contract.md +58 -0
- package/skills/core/dingtalk-agent-compose/references/hosts/claude-code.md +48 -0
- package/skills/core/dingtalk-agent-compose/references/hosts/opencode.md +77 -0
- package/skills/{dingtalk-agent-eval → core/dingtalk-agent-eval}/SKILL.md +57 -8
- package/skills/{dingtalk-agent-eval → core/dingtalk-agent-eval}/assets/eval-catalog.template.json +1 -1
- package/skills/{dingtalk-agent-eval → core/dingtalk-agent-eval}/evals/evals.json +22 -0
- package/skills/{dingtalk-agent-eval → core/dingtalk-agent-eval}/references/eval-topology.md +14 -0
- package/skills/{dingtalk-agent-eval → core/dingtalk-agent-eval}/references/evidence-contract.md +21 -0
- package/skills/core/dingtalk-agent-eval/references/failure-to-case.md +35 -0
- package/skills/core/dingtalk-agent-eval/references/interactive-debug-channels.md +93 -0
- package/skills/core/dingtalk-agent-eval/references/local-connector-smoke.md +75 -0
- package/skills/core/dingtalk-basic-behavior/SKILL.md +87 -0
- package/skills/{dingtalk-basic-behavior → core/dingtalk-basic-behavior}/references/memory-and-evolution.md +12 -0
- package/skills/core/dingtalk-basic-behavior/references/risk-authority-and-privacy.md +62 -0
- package/skills/{dingtalk-basic-behavior → core/dingtalk-basic-behavior}/references/task-lifecycle.md +15 -3
- package/skills/core/dingtalk-basic-behavior/references/truth-and-recovery.md +65 -0
- package/skills/platforms/deap/PLATFORM.md +3 -0
- package/skills/platforms/multica-dingtalk/PLATFORM.md +40 -0
- package/skills/{dingtalk-agent-boot-multica → platforms/multica-dingtalk/dingtalk-agent-boot-multica}/SKILL.md +4 -4
- package/skills/{dingtalk-agent-deploy → platforms/multica-dingtalk/dingtalk-agent-deploy-multica}/SKILL.md +1 -1
- package/skills/platforms/multica-dingtalk/multica-external/SKILL.md +282 -0
- package/skills/platforms/multica-dingtalk/multica-external/scripts/bootstrap.sh +78 -0
- package/skills/platforms/multica-dingtalk/multica-external/scripts/multica_ext.py +1180 -0
- package/docs/SECOND-AGENT-ACCEPTANCE.md +0 -62
- package/docs/architecture/agent-memory-topology.png +0 -0
- package/docs/architecture/agent-memory-topology.svg +0 -132
- package/docs/architecture/dingtalk-agent-blueprint.png +0 -0
- package/docs/architecture/durable-async-agent-runtime.png +0 -0
- package/docs/architecture/general-agent-kernel-topology.png +0 -0
- package/docs/architecture/provider-bound-development-workspace.png +0 -0
- package/docs/architecture/task-completion-gate.png +0 -0
- package/skills/dingtalk-agent-compose/SKILL.md +0 -110
- package/skills/dingtalk-agent-compose/assets/AGENTS.template.md +0 -26
- package/skills/dingtalk-agent-compose/assets/role-skill.template.md +0 -24
- package/skills/dingtalk-agent-compose/evals/evals.json +0 -94
- package/skills/dingtalk-agent-compose/references/opencode-host-contract.md +0 -65
- package/skills/dingtalk-basic-behavior/SKILL.md +0 -146
- /package/skills/{dingtalk-agent-compose → core/dingtalk-agent-compose}/assets/agent.bindings.dingtalk-doc.template.json +0 -0
- /package/skills/{dingtalk-agent-compose → core/dingtalk-agent-compose}/assets/agent.bindings.local.template.json +0 -0
- /package/skills/{dingtalk-agent-compose/assets → core/dingtalk-agent-compose/assets/hosts/opencode}/opencode.template.json +0 -0
- /package/skills/{dingtalk-agent-compose → core/dingtalk-agent-compose}/references/storage-routing.md +0 -0
- /package/skills/{dingtalk-agent-eval → core/dingtalk-agent-eval}/references/scenario-taxonomy.md +0 -0
- /package/skills/{dingtalk-agent-eval → core/dingtalk-agent-eval}/references/storage-modes.md +0 -0
- /package/skills/{dingtalk-basic-behavior → core/dingtalk-basic-behavior}/assets/memory-candidate-proposal.json +0 -0
- /package/skills/{dingtalk-basic-behavior → core/dingtalk-basic-behavior}/assets/task-checkpoint.json +0 -0
- /package/skills/{dingtalk-basic-behavior → core/dingtalk-basic-behavior}/references/action-contract.md +0 -0
- /package/skills/{dingtalk-basic-behavior → core/dingtalk-basic-behavior}/references/event-to-behavior.md +0 -0
- /package/skills/{dingtalk-basic-behavior → core/dingtalk-basic-behavior}/references/perception-and-gates.md +0 -0
- /package/skills/{dingtalk-basic-behavior → core/dingtalk-basic-behavior}/references/runtime-modes.md +0 -0
- /package/skills/{dingtalk-agent-deploy → platforms/multica-dingtalk/dingtalk-agent-deploy-multica}/references/multica-deployment-contract.md +0 -0
- /package/skills/{dingtalk-agent-deploy → platforms/multica-dingtalk/dingtalk-agent-deploy-multica}/references/promotion-observation-contract.md +0 -0
|
@@ -7,6 +7,7 @@ import { WORKSPACE_STATE_ROOT, inspectAgentProject, showDevelopmentWorkspace, }
|
|
|
7
7
|
import { digest, stableStringify } from './events.js';
|
|
8
8
|
import { MULTICA_BOOT_SKILL, MULTICA_EVIDENCE_ROOT, inspectMulticaWorkspace, planMulticaWorkspace, statusMulticaWorkspace, } from './multica-provider.js';
|
|
9
9
|
import { resolvePackageRoot } from './package-root.js';
|
|
10
|
+
import { bundledSkillPath } from './skill-manager.js';
|
|
10
11
|
export const MULTICA_DEPLOYMENT_SCHEMA = 'dingtalk-agent/multica-deployment-receipt@1';
|
|
11
12
|
const MAX_DEPLOY_SKILLS = 32;
|
|
12
13
|
const MAX_SKILL_SUPPORTING_FILES = 128;
|
|
@@ -80,7 +81,7 @@ export function planMulticaDeployment(start, name, options = {}) {
|
|
|
80
81
|
workspaceId: readPlan.expected.workspaceId,
|
|
81
82
|
runtimeId: readPlan.expected.runtimeId,
|
|
82
83
|
agentId: readPlan.expected.agentId,
|
|
83
|
-
agentName: info.project.
|
|
84
|
+
agentName: info.project.displayName,
|
|
84
85
|
skills: expectedSkills,
|
|
85
86
|
definitionHash: source.definitionHash,
|
|
86
87
|
instructionsHash: source.instructionsHash,
|
|
@@ -350,7 +351,7 @@ function loadDeploymentSource(root) {
|
|
|
350
351
|
const packageRoot = resolvePackageRoot(import.meta.url);
|
|
351
352
|
skillRoots.push({
|
|
352
353
|
name: MULTICA_BOOT_SKILL,
|
|
353
|
-
root: safeExternalSkillRoot(
|
|
354
|
+
root: safeExternalSkillRoot(bundledSkillPath(packageRoot, MULTICA_BOOT_SKILL)),
|
|
354
355
|
});
|
|
355
356
|
if (skillRoots.length > MAX_DEPLOY_SKILLS) {
|
|
356
357
|
throw new Error(`Multica deploy 最多支持 ${MAX_DEPLOY_SKILLS} 个受管 Skills`);
|
|
@@ -598,24 +599,20 @@ function readSmoke(root, plan, marker, issueId, agentId, requiredSkills, command
|
|
|
598
599
|
'issue', 'run-messages', taskId, '--issue', issueId, '--output', 'json',
|
|
599
600
|
]), 'smoke.issue.messages', 'read', root, env, timeoutMs, calls).stdout, 'smoke messages');
|
|
600
601
|
const toolUses = messages.filter((item) => optionalString(item.type) === 'tool_use');
|
|
601
|
-
const
|
|
602
|
-
const
|
|
602
|
+
const skillToolUses = toolUses.filter((item) => optionalString(item.tool) === 'skill');
|
|
603
|
+
const skillNames = skillToolUses.map((item) => smokeToolInput(item).name)
|
|
604
|
+
.filter((item) => typeof item === 'string' && Boolean(item)).sort();
|
|
605
|
+
const loadedSkills = requiredSkills.filter((name) => skillNames.includes(name)).sort();
|
|
603
606
|
const texts = messages.filter((item) => optionalString(item.type) === 'text')
|
|
604
607
|
.map((item) => optionalString(item.content)).filter(Boolean);
|
|
605
608
|
const finalText = texts.at(-1) || '';
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
}
|
|
614
|
-
catch {
|
|
615
|
-
responsePassed = false;
|
|
616
|
-
}
|
|
617
|
-
const toolTracePassed = nonSkillTools.length === 0 &&
|
|
618
|
-
stableStringify(loadedSkills) === stableStringify(requiredSkills);
|
|
609
|
+
const matchesResponse = (value) => smokeResponseMatches(value, marker, requiredSkills);
|
|
610
|
+
const replyWrites = toolUses.filter((item) => optionalString(item.tool) === 'write')
|
|
611
|
+
.map((item) => smokeToolInput(item)).filter((input) => optionalString(input.filePath).endsWith('/reply.md'))
|
|
612
|
+
.map((input) => optionalString(input.content)).filter(Boolean);
|
|
613
|
+
const responseEvidence = [...texts, ...replyWrites].find(matchesResponse) || '';
|
|
614
|
+
const responsePassed = Boolean(responseEvidence);
|
|
615
|
+
const toolTracePassed = toolUses.every((item) => allowedSmokeToolUse(item, issueId, marker, requiredSkills)) && stableStringify(skillNames) === stableStringify(requiredSkills);
|
|
619
616
|
const failures = [];
|
|
620
617
|
if (taskStatus !== 'completed')
|
|
621
618
|
failures.push(`smoke.task.${taskStatus || 'unknown'}`);
|
|
@@ -626,9 +623,70 @@ function readSmoke(root, plan, marker, issueId, agentId, requiredSkills, command
|
|
|
626
623
|
return {
|
|
627
624
|
status: failures.length ? 'failed' : 'passed',
|
|
628
625
|
marker, markerHash: sha256(marker), issueId, taskId, taskStatus, requiredSkills, loadedSkills,
|
|
629
|
-
toolTracePassed, responsePassed, responseHash: sha256(finalText), failures,
|
|
626
|
+
toolTracePassed, responsePassed, responseHash: sha256(responseEvidence || finalText), failures,
|
|
630
627
|
};
|
|
631
628
|
}
|
|
629
|
+
function smokeToolInput(item) {
|
|
630
|
+
return item.input && typeof item.input === 'object' && !Array.isArray(item.input)
|
|
631
|
+
? item.input : {};
|
|
632
|
+
}
|
|
633
|
+
function smokeResponseMatches(value, marker, requiredSkills) {
|
|
634
|
+
try {
|
|
635
|
+
const parsed = JSON.parse(value);
|
|
636
|
+
return parsed?.schema === 'dta-multica-load-smoke@1' && parsed?.marker === marker &&
|
|
637
|
+
stableStringify(Array.isArray(parsed?.loaded) ? [...parsed.loaded].sort() : []) ===
|
|
638
|
+
stableStringify(requiredSkills);
|
|
639
|
+
}
|
|
640
|
+
catch {
|
|
641
|
+
return false;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
function allowedSmokeToolUse(item, issueId, marker, requiredSkills) {
|
|
645
|
+
const tool = optionalString(item.tool);
|
|
646
|
+
if (tool === 'skill')
|
|
647
|
+
return true;
|
|
648
|
+
const input = smokeToolInput(item);
|
|
649
|
+
if (tool === 'write') {
|
|
650
|
+
return safeSmokeReplyPath(optionalString(input.filePath)) &&
|
|
651
|
+
smokeResponseMatches(optionalString(input.content), marker, requiredSkills);
|
|
652
|
+
}
|
|
653
|
+
if (tool !== 'bash')
|
|
654
|
+
return false;
|
|
655
|
+
const command = optionalString(input.command);
|
|
656
|
+
if (new Set([
|
|
657
|
+
`multica issue get ${issueId} --output json`,
|
|
658
|
+
`multica issue metadata list ${issueId} --output json`,
|
|
659
|
+
`multica issue comment list ${issueId} --recent 10 --output json`,
|
|
660
|
+
`multica issue status ${issueId} in_progress`,
|
|
661
|
+
`multica issue status ${issueId} in_review`,
|
|
662
|
+
]).has(command))
|
|
663
|
+
return true;
|
|
664
|
+
const commentPrefix = `multica issue comment add ${issueId} --content-file `;
|
|
665
|
+
if (command.startsWith(commentPrefix)) {
|
|
666
|
+
return safeSmokeReplyPath(command.slice(commentPrefix.length));
|
|
667
|
+
}
|
|
668
|
+
const cleanupFirstPrefix = 'rm ';
|
|
669
|
+
const cleanupFirstSuffix = ` && multica issue status ${issueId} in_review`;
|
|
670
|
+
if (command.startsWith(cleanupFirstPrefix) && command.endsWith(cleanupFirstSuffix)) {
|
|
671
|
+
return safeSmokeReplyPath(command.slice(cleanupFirstPrefix.length, command.length - cleanupFirstSuffix.length));
|
|
672
|
+
}
|
|
673
|
+
const statusFirstPrefix = `multica issue status ${issueId} in_review && rm `;
|
|
674
|
+
if (command.startsWith(statusFirstPrefix)) {
|
|
675
|
+
return safeSmokeReplyPath(command.slice(statusFirstPrefix.length));
|
|
676
|
+
}
|
|
677
|
+
if (command.startsWith(cleanupFirstPrefix)) {
|
|
678
|
+
return safeSmokeReplyPath(command.slice(cleanupFirstPrefix.length));
|
|
679
|
+
}
|
|
680
|
+
return false;
|
|
681
|
+
}
|
|
682
|
+
function safeSmokeReplyPath(value) {
|
|
683
|
+
if (value === './reply.md')
|
|
684
|
+
return true;
|
|
685
|
+
if (!value.startsWith('/') || !value.endsWith('/reply.md'))
|
|
686
|
+
return false;
|
|
687
|
+
return value.split('/').every((part) => !part ||
|
|
688
|
+
(part !== '.' && part !== '..' && /^[A-Za-z0-9._-]+$/.test(part)));
|
|
689
|
+
}
|
|
632
690
|
function rollbackConfirmed(root, plan, command, env, timeoutMs, calls, rollback, temp) {
|
|
633
691
|
const report = emptyRollback(true);
|
|
634
692
|
const attempt = (id, argv) => {
|
|
@@ -833,7 +891,7 @@ export function statusMulticaDeployment(start, name, options = {}) {
|
|
|
833
891
|
const matched = Boolean(snapshot && remoteMatchesDesired(snapshot, source, operation.runtimeId));
|
|
834
892
|
const safelyBound = Boolean(snapshot?.agent && inspection.passed &&
|
|
835
893
|
snapshot.agent.id === operation.agentId &&
|
|
836
|
-
snapshot.agent.name === info.project.
|
|
894
|
+
snapshot.agent.name === info.project.displayName &&
|
|
837
895
|
snapshot.agent.runtimeId === operation.runtimeId &&
|
|
838
896
|
snapshot.agent.instructions === source.instructions && !snapshot.agent.archived);
|
|
839
897
|
receipt = { ...receipt,
|
|
@@ -934,7 +992,7 @@ function reconcileRemoteTarget(root, name, operation, source, command, env, time
|
|
|
934
992
|
if (candidates.length > 10) {
|
|
935
993
|
return { inspection: discovery, snapshot: null, failures: ['reconcile.agent-candidate-budget'] };
|
|
936
994
|
}
|
|
937
|
-
const projectName = inspectAgentProject(root).project.
|
|
995
|
+
const projectName = inspectAgentProject(root).project.displayName;
|
|
938
996
|
const matches = [];
|
|
939
997
|
for (const [index, candidate] of candidates.entries()) {
|
|
940
998
|
const inspection = inspectMulticaWorkspace(root, name, {
|