fix(m2): actionOf — поля объекта выровнены с B4 (ловит MCP filename/uri/destination) (F1)
This commit is contained in:
@@ -48,7 +48,8 @@ export function actionOf(toolUse) {
|
||||
if (op === 'Bash') object = i.command || '';
|
||||
else if (op === 'Skill') object = i.skill || '';
|
||||
else if (op === 'Task') object = i.subagent_type || '';
|
||||
else object = i.file_path || i.notebook_path || i.path || i.target_file || '';
|
||||
// F1 (2026-06-05): поля выровнены с extractPath (B4) — MCP-писатели несут путь под разными именами.
|
||||
else object = i.file_path || i.notebook_path || i.path || i.target_file || i.filename || i.destination || i.dest || i.output_path || i.uri || '';
|
||||
return { op, object };
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,14 @@ describe('isSeed (D12/D13 bootstrap exemption)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('actionOf — поля объекта (F1, выровнено с B4)', () => {
|
||||
it('берёт объект из доп. полей MCP-писателей (filename/uri/destination)', () => {
|
||||
expect(actionOf({ name: 'mcp__fs__write', input: { filename: 'tools/foo.mjs' } }).object).toBe('tools/foo.mjs');
|
||||
expect(actionOf({ name: 'mcp__x', input: { uri: 'a/b.txt' } }).object).toBe('a/b.txt');
|
||||
expect(actionOf({ name: 'mcp__y', input: { destination: 'd/e.json' } }).object).toBe('d/e.json');
|
||||
});
|
||||
});
|
||||
|
||||
const KEY = 'supreme-key';
|
||||
const PLAN = {
|
||||
plan_id: 'x', frozen_at: 1,
|
||||
|
||||
Reference in New Issue
Block a user