@xdxer/dingtalk-agent 0.1.5-beta.13 → 0.1.5-beta.15
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 +29 -0
- package/README.en.md +10 -6
- package/README.md +13 -8
- package/dist/bin/dingtalk-agent.js +7 -6
- package/dist/bin/dingtalk-agent.js.map +1 -1
- package/dist/src/agent-audit.js +28 -10
- package/dist/src/agent-audit.js.map +1 -1
- package/dist/src/agent-enhance.js +63 -30
- package/dist/src/agent-enhance.js.map +1 -1
- package/dist/src/opencode-evals.js +28 -16
- package/dist/src/opencode-evals.js.map +1 -1
- package/dist/src/opencode-workspace.js +1 -0
- package/dist/src/opencode-workspace.js.map +1 -1
- package/docs/ARCHITECTURE.md +15 -13
- package/docs/INSTALLATION.md +4 -2
- package/docs/SELF-TEST.md +1 -1
- package/docs/architecture/agent-platform-connection-layer.svg +1 -1
- package/docs/architecture/dingtalk-agent-architecture.svg +1 -1
- package/docs/schemas/agent-enhancement-plan.schema.json +2 -1
- package/docs/schemas/agent-enhancement-receipt.schema.json +2 -1
- package/lab/agent-eval/remote-state.example.json +1 -1
- package/lab/project-workspace/project.fixture.json +1 -1
- package/lab/robot-eval/pool.example.json +1 -1
- package/package.json +2 -2
- package/skills/core/dta-agent-compose/SKILL.md +5 -3
package/dist/src/agent-audit.js
CHANGED
|
@@ -6,7 +6,7 @@ import { dirname, isAbsolute, join, parse, relative, resolve } from 'node:path';
|
|
|
6
6
|
import { bootstrap } from './bootstrap.js';
|
|
7
7
|
import { digest, stableStringify } from './events.js';
|
|
8
8
|
import { prepareOpenCodeEvalAgent, resolveOpenCodeEvalAgent, readOpenCodeVersion, runOpenCodeEvaluation, runOpenCodePrompt, loadProbeCorePassed, OPENCODE_LOAD_PROBE_PROMPT, } from './opencode-evals.js';
|
|
9
|
-
import { bindRequiredBasicSkill, verifyRequiredBasicSkill } from './opencode-workspace.js';
|
|
9
|
+
import { bindRequiredBasicSkill, DEFAULT_OPENCODE_MODEL, verifyRequiredBasicSkill, } from './opencode-workspace.js';
|
|
10
10
|
import { countInstructionsForPath } from './instruction-path.js';
|
|
11
11
|
import { resolvePackageRoot } from './package-root.js';
|
|
12
12
|
import { bundledSkillPath, isBasicSkillName } from './skill-manager.js';
|
|
@@ -125,7 +125,7 @@ export function auditAgent(root, options = {}) {
|
|
|
125
125
|
const staticPrerequisitesReady = checks
|
|
126
126
|
.filter((item) => item.blocking)
|
|
127
127
|
.every((item) => item.level === 'pass');
|
|
128
|
-
const effectiveModel = options.model ||
|
|
128
|
+
const effectiveModel = options.model || DEFAULT_OPENCODE_MODEL;
|
|
129
129
|
const loadTargetHash = currentLoadTargetHash(rootReal, options, requiredSkills, effectiveModel);
|
|
130
130
|
let loadReport = null;
|
|
131
131
|
let loadReportPath = '';
|
|
@@ -705,6 +705,7 @@ function executeInheritanceProbe(sourceRoot, model, command, timeoutMs, reportEv
|
|
|
705
705
|
realpathIfExists(referenceExecution.toolPaths[0]) === referenceReal;
|
|
706
706
|
const definitionRaw = persistProbeExecution(reportEvidenceRoot, 'definition', definitionExecution);
|
|
707
707
|
const referenceRaw = persistProbeExecution(reportEvidenceRoot, 'reference', referenceExecution);
|
|
708
|
+
const referenceAnswerPassed = terminalSingleProbeAnswer(referenceExecution.answer, expectedReference);
|
|
708
709
|
const result = {
|
|
709
710
|
passed: Boolean(definitionInstruction) && basicResolvedCount === 1 &&
|
|
710
711
|
definitionPermissionPassed && referencePermissionPassed &&
|
|
@@ -712,7 +713,7 @@ function executeInheritanceProbe(sourceRoot, model, command, timeoutMs, reportEv
|
|
|
712
713
|
definitionExecution.toolCalls === 0 &&
|
|
713
714
|
definitionExecution.answer.trim() === expectedDefinition &&
|
|
714
715
|
referenceExecution.exitCode === 0 && referenceExecution.directoryMatched &&
|
|
715
|
-
|
|
716
|
+
referenceAnswerPassed &&
|
|
716
717
|
referenceRead && referenceFullRead && referenceToolsScoped,
|
|
717
718
|
definition: executionProbeSummary(definitionExecution, expectedDefinition, {
|
|
718
719
|
nativeRule: definitionInstruction,
|
|
@@ -727,7 +728,7 @@ function executeInheritanceProbe(sourceRoot, model, command, timeoutMs, reportEv
|
|
|
727
728
|
permissionPassed: referencePermissionPassed,
|
|
728
729
|
evalAgent: referenceEvalAgent,
|
|
729
730
|
raw: referenceRaw,
|
|
730
|
-
}, sandbox),
|
|
731
|
+
}, sandbox, 'terminal-single-probe'),
|
|
731
732
|
host: {
|
|
732
733
|
model,
|
|
733
734
|
openCodeVersion: preflight.openCodeVersion,
|
|
@@ -758,13 +759,19 @@ function initializeProbeWorktree(workspace) {
|
|
|
758
759
|
throw new Error(`继承探针无法初始化隔离 git worktree: ${child.error?.message || String(child.stderr || child.stdout || '').trim()}`);
|
|
759
760
|
}
|
|
760
761
|
}
|
|
761
|
-
function executionProbeSummary(execution, expected, extra, sandbox) {
|
|
762
|
+
function executionProbeSummary(execution, expected, extra, sandbox, answerContract = 'exact') {
|
|
763
|
+
const answer = execution.answer.trim();
|
|
764
|
+
const answerPassed = answerContract === 'terminal-single-probe'
|
|
765
|
+
? terminalSingleProbeAnswer(answer, expected)
|
|
766
|
+
: answer === expected;
|
|
762
767
|
return {
|
|
763
768
|
passed: execution.exitCode === 0 && execution.directoryMatched &&
|
|
764
|
-
|
|
765
|
-
exact:
|
|
769
|
+
answerPassed,
|
|
770
|
+
exact: answer === expected,
|
|
771
|
+
answerContract,
|
|
772
|
+
terminalSingleProbe: terminalSingleProbeAnswer(answer, expected),
|
|
766
773
|
expected,
|
|
767
|
-
answer
|
|
774
|
+
answer,
|
|
768
775
|
exitCode: execution.exitCode,
|
|
769
776
|
directoryMatched: execution.directoryMatched,
|
|
770
777
|
sessionId: execution.sessionId,
|
|
@@ -780,6 +787,15 @@ function executionProbeSummary(execution, expected, extra, sandbox) {
|
|
|
780
787
|
...extra,
|
|
781
788
|
};
|
|
782
789
|
}
|
|
790
|
+
function terminalSingleProbeAnswer(answer, expected) {
|
|
791
|
+
if (typeof answer !== 'string' || typeof expected !== 'string' || !expected)
|
|
792
|
+
return false;
|
|
793
|
+
const normalized = answer.trim();
|
|
794
|
+
const lines = normalized.split(/\r?\n/);
|
|
795
|
+
const probeTokens = normalized.match(/dta-(?:definition|reference|load)-probe=[^\s`]+/g) || [];
|
|
796
|
+
return lines.at(-1) === expected &&
|
|
797
|
+
probeTokens.length === 1 && probeTokens[0] === expected;
|
|
798
|
+
}
|
|
783
799
|
function persistProbeExecution(reportRoot, name, execution) {
|
|
784
800
|
const evidenceRoot = join(reportRoot, 'inheritance-probes');
|
|
785
801
|
mkdirSync(evidenceRoot, { recursive: true });
|
|
@@ -1048,7 +1064,8 @@ function verifyLoadReport(root, reportPath, report, basic, definitionInstruction
|
|
|
1048
1064
|
const referencePassed = reference.path ===
|
|
1049
1065
|
'.agents/skills/dta-basic-behavior/references/risk-authority-and-privacy.md' &&
|
|
1050
1066
|
validRandomProbe(reference.expected, 'dta-reference-probe') &&
|
|
1051
|
-
reference.answer
|
|
1067
|
+
terminalSingleProbeAnswer(reference.answer, reference.expected) &&
|
|
1068
|
+
reference.exitCode === 0 &&
|
|
1052
1069
|
reference.directoryMatched === true && referenceRead && referenceFullRead &&
|
|
1053
1070
|
reference.fullRead === true && referenceToolsScoped &&
|
|
1054
1071
|
reference.permissionPassed === true &&
|
|
@@ -1104,7 +1121,8 @@ function verifyLoadReport(root, reportPath, report, basic, definitionInstruction
|
|
|
1104
1121
|
}
|
|
1105
1122
|
if (!referencePassed) {
|
|
1106
1123
|
failureSummary.push('inheritance.reference: ' +
|
|
1107
|
-
`answer=${reference.answer
|
|
1124
|
+
`answer=${terminalSingleProbeAnswer(reference.answer, reference.expected)
|
|
1125
|
+
? 'terminal-single-probe' : 'mismatch'} ` +
|
|
1108
1126
|
`exitCode=${reference.exitCode ?? '?'} durationMs=${reference.durationMs ?? '?'} ` +
|
|
1109
1127
|
`fullRead=${reference.fullRead === true}`);
|
|
1110
1128
|
}
|