@zhixuan92/multi-model-agent-core 4.5.0 → 4.5.2

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 (77) hide show
  1. package/README.md +6 -6
  2. package/dist/escalation/fallback-helpers.d.ts.map +1 -1
  3. package/dist/escalation/fallback-helpers.js +0 -1
  4. package/dist/escalation/fallback-helpers.js.map +1 -1
  5. package/dist/events/event-builder.d.ts.map +1 -1
  6. package/dist/events/event-builder.js +41 -11
  7. package/dist/events/event-builder.js.map +1 -1
  8. package/dist/index.d.ts +0 -2
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +0 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/lifecycle/lifecycle-context.d.ts +0 -2
  13. package/dist/lifecycle/lifecycle-context.d.ts.map +1 -1
  14. package/dist/lifecycle/task-executor.d.ts.map +1 -1
  15. package/dist/lifecycle/task-executor.js +5 -7
  16. package/dist/lifecycle/task-executor.js.map +1 -1
  17. package/dist/lifecycle/task-runner.d.ts +0 -2
  18. package/dist/lifecycle/task-runner.d.ts.map +1 -1
  19. package/dist/lifecycle/task-runner.js +1 -9
  20. package/dist/lifecycle/task-runner.js.map +1 -1
  21. package/dist/providers/codex-cli-session.d.ts +1 -1
  22. package/dist/providers/codex-cli-session.d.ts.map +1 -1
  23. package/dist/providers/codex-cli-session.js +6 -1
  24. package/dist/providers/codex-cli-session.js.map +1 -1
  25. package/dist/reporting/headline-templates/audit.d.ts.map +1 -1
  26. package/dist/reporting/headline-templates/audit.js +10 -14
  27. package/dist/reporting/headline-templates/audit.js.map +1 -1
  28. package/dist/reporting/headline-templates/debug.d.ts +3 -5
  29. package/dist/reporting/headline-templates/debug.d.ts.map +1 -1
  30. package/dist/reporting/headline-templates/debug.js +5 -8
  31. package/dist/reporting/headline-templates/debug.js.map +1 -1
  32. package/dist/reporting/headline-templates/review.d.ts.map +1 -1
  33. package/dist/reporting/headline-templates/review.js +6 -7
  34. package/dist/reporting/headline-templates/review.js.map +1 -1
  35. package/dist/review/default-engines.d.ts +0 -2
  36. package/dist/review/default-engines.d.ts.map +1 -1
  37. package/dist/review/default-engines.js +0 -4
  38. package/dist/review/default-engines.js.map +1 -1
  39. package/dist/review/index.d.ts +0 -4
  40. package/dist/review/index.d.ts.map +1 -1
  41. package/dist/review/index.js +0 -4
  42. package/dist/review/index.js.map +1 -1
  43. package/dist/review/review-types.d.ts +0 -16
  44. package/dist/review/review-types.d.ts.map +1 -1
  45. package/dist/review/review-types.js +4 -1
  46. package/dist/review/review-types.js.map +1 -1
  47. package/dist/tools/audit/plan-audit-criteria.d.ts.map +1 -1
  48. package/dist/tools/audit/plan-audit-criteria.js +41 -18
  49. package/dist/tools/audit/plan-audit-criteria.js.map +1 -1
  50. package/dist/tools/audit/spec-audit-criteria.d.ts.map +1 -1
  51. package/dist/tools/audit/spec-audit-criteria.js +5 -3
  52. package/dist/tools/audit/spec-audit-criteria.js.map +1 -1
  53. package/dist/tools/audit/tool-config.js +2 -2
  54. package/dist/tools/audit/tool-config.js.map +1 -1
  55. package/dist/types/run-result.d.ts +0 -11
  56. package/dist/types/run-result.d.ts.map +1 -1
  57. package/package.json +3 -1
  58. package/dist/reporting/annotate-completion-parser.d.ts +0 -39
  59. package/dist/reporting/annotate-completion-parser.d.ts.map +0 -1
  60. package/dist/reporting/annotate-completion-parser.js +0 -43
  61. package/dist/reporting/annotate-completion-parser.js.map +0 -1
  62. package/dist/review/annotator-engine.d.ts +0 -44
  63. package/dist/review/annotator-engine.d.ts.map +0 -1
  64. package/dist/review/annotator-engine.js +0 -115
  65. package/dist/review/annotator-engine.js.map +0 -1
  66. package/dist/review/annotator-output-parser.d.ts +0 -13
  67. package/dist/review/annotator-output-parser.d.ts.map +0 -1
  68. package/dist/review/annotator-output-parser.js +0 -104
  69. package/dist/review/annotator-output-parser.js.map +0 -1
  70. package/dist/review/annotator-prompt-builder.d.ts +0 -29
  71. package/dist/review/annotator-prompt-builder.d.ts.map +0 -1
  72. package/dist/review/annotator-prompt-builder.js +0 -87
  73. package/dist/review/annotator-prompt-builder.js.map +0 -1
  74. package/dist/review/review-verdict-aggregator.d.ts +0 -17
  75. package/dist/review/review-verdict-aggregator.d.ts.map +0 -1
  76. package/dist/review/review-verdict-aggregator.js +0 -30
  77. package/dist/review/review-verdict-aggregator.js.map +0 -1
@@ -1,87 +0,0 @@
1
- import { buildAnnotatorRubric } from './templates/annotator-shared.js';
2
- export class AnnotatorPromptBuilder {
3
- templates;
4
- constructor(templates) {
5
- this.templates = templates;
6
- }
7
- build(route, ctx) {
8
- return assembleAnnotatorPrompt(this.templates[route], ctx);
9
- }
10
- }
11
- /**
12
- * Trim the implementer brief down to the "what was asked" essentials
13
- * before sending to the annotator. The annotator does NOT need the
14
- * finding-format spec (it has its own format spec via buildAnnotatorRubric)
15
- * or the delta-mode instructions. Sending the full brief wastes
16
- * 1-3KB context per call and mildly distracts the model.
17
- *
18
- * Two prompt shapes covered:
19
- *
20
- * 1. **Goal-first** (audit / review / verify / debug):
21
- * `<goal + scope>\n\n<format spec at the END>` — slice off the
22
- * format spec, keep everything before it.
23
- *
24
- * 2. **Spec-first** (investigate): the brief opens with the
25
- * structured-format instructions and ends with `Question: <text>`.
26
- * Pull the question line out as the compact brief.
27
- *
28
- * If neither shape applies, the brief is returned unchanged.
29
- */
30
- export function trimBriefForAnnotator(brief) {
31
- if (typeof brief !== 'string' || brief.length === 0)
32
- return brief;
33
- // Shape 2 (investigate): pull the `Question: ...` line out.
34
- const questionMatch = brief.match(/^\s*Question:\s+(.+)$/m);
35
- if (questionMatch) {
36
- return `Question: ${questionMatch[1].trim()}`;
37
- }
38
- // Shape 1 (audit / review / verify / debug): slice before the first
39
- // format-spec marker. Each per-tool implementer prompt structures
40
- // the goal at the top, format spec at the bottom — so this gives
41
- // the annotator the goal + scope without the duplicated format
42
- // instructions.
43
- const markers = [
44
- /\nProduce a narrative .* report\./i,
45
- /\nFor each checklist item, use this EXACT/i,
46
- /\nUse hypothesis-driven debugging\./i,
47
- /\n## Finding 1:/i,
48
- /\nUse this EXACT per-finding format/i,
49
- ];
50
- let cut = brief.length;
51
- for (const m of markers) {
52
- const idx = brief.search(m);
53
- if (idx >= 0 && idx < cut)
54
- cut = idx;
55
- }
56
- return brief.slice(0, cut).trim();
57
- }
58
- export function assembleAnnotatorPrompt(template, ctx) {
59
- // Tool sweep #11: trim the brief — the format-spec section is
60
- // duplicated by buildAnnotatorRubric below, so sending it again is
61
- // redundant + costly.
62
- const compactBrief = trimBriefForAnnotator(ctx.brief);
63
- // Multi-narrative merge mode: each sub-worker covered ONE criterion.
64
- // The annotator dedups overlapping findings and recalibrates severity
65
- // against the shared SEVERITY_LADDER. Single-narrative inputs (e.g.
66
- // a route that hasn't migrated to fan-out) take the same path with N=1.
67
- const sections = ctx.workerOutputs.map(o => `--- Sub-worker for ${o.criterion} ---\n${o.narrative}`).join('\n\n');
68
- const mergeInstructions = ctx.workerOutputs.length > 1
69
- ? `\n## Merge instructions (text-only — do NOT read files; you have no tools)\n\nThe worker output below is N narratives, each from a sub-worker that covered ONE criterion. Merge them into a single findings list using ONLY the text below — no file reads, no greps. Your job:\n1. Combine findings across narratives into one list.\n2. Dedup by (file, line, claim essence) using TEXTUAL comparison — if two findings name the same file:line and describe the same issue in different words, KEEP ONE (higher severity wins; merge any non-redundant evidence quoted in their text).\n3. Recalibrate severity using the shared severity ladder so a sub-worker that inflated within its narrow scope is rebucketed against the global picture.\n4. Drop narratives that contained no findings (valid empty results, not parse failures).\n5. **DROP findings whose title starts with "[N/A]"** — completeness signals from sub-workers reporting "this perspective does not apply." MUST NOT appear in the final array.\n6. Do NOT speculate, expand, re-investigate, or "verify" findings against the source — your input is the narratives only. If you can't dedup confidently from the text, keep both findings and let the reader decide.\n\n`
70
- : '';
71
- return `You are reviewing a ${template.role} produced by a worker.
72
-
73
- The user requested a ${template.role}. The brief was:
74
-
75
- ${compactBrief}
76
-
77
- ## On-brief check (per finding)
78
-
79
- ${template.onBriefCheck}
80
- ${mergeInstructions}
81
- ## Worker output to extract findings from
82
-
83
- ${sections}
84
-
85
- ${buildAnnotatorRubric(template)}`;
86
- }
87
- //# sourceMappingURL=annotator-prompt-builder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotator-prompt-builder.js","sourceRoot":"","sources":["../../src/review/annotator-prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAuD,MAAM,iCAAiC,CAAC;AAI5H,MAAM,OAAO,sBAAsB;IAEvB;IADV,YACU,SAAoD;QAApD,cAAS,GAAT,SAAS,CAA2C;IAC3D,CAAC;IAEJ,KAAK,CAAC,KAAqB,EAAE,GAA2B;QACtD,OAAO,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;IAC7D,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAElE,4DAA4D;IAC5D,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5D,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,aAAa,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;IAChD,CAAC;IAED,oEAAoE;IACpE,kEAAkE;IAClE,iEAAiE;IACjE,+DAA+D;IAC/D,gBAAgB;IAChB,MAAM,OAAO,GAAG;QACd,oCAAoC;QACpC,4CAA4C;QAC5C,sCAAsC;QACtC,kBAAkB;QAClB,sCAAsC;KACvC,CAAC;IACF,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IACvB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,GAAG,GAAG;YAAE,GAAG,GAAG,GAAG,CAAC;IACvC,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,QAA2B,EAAE,GAA2B;IAC9F,8DAA8D;IAC9D,mEAAmE;IACnE,sBAAsB;IACtB,MAAM,YAAY,GAAG,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEtD,qEAAqE;IACrE,sEAAsE;IACtE,oEAAoE;IACpE,wEAAwE;IACxE,MAAM,QAAQ,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACzC,sBAAsB,CAAC,CAAC,SAAS,SAAS,CAAC,CAAC,SAAS,EAAE,CACxD,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEf,MAAM,iBAAiB,GAAG,GAAG,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;QACpD,CAAC,CAAC,yrCAAyrC;QAC3rC,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,uBAAuB,QAAQ,CAAC,IAAI;;uBAEtB,QAAQ,CAAC,IAAI;;EAElC,YAAY;;;;EAIZ,QAAQ,CAAC,YAAY;EACrB,iBAAiB;;;EAGjB,QAAQ;;EAER,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC;AACnC,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { ReviewVerdict } from '../types.js';
2
- export interface ReviewSlot {
3
- verdict: ReviewVerdict;
4
- concerns?: string[];
5
- }
6
- export interface AggregatedReviews {
7
- finalVerdict: ReviewVerdict;
8
- allConcerns: string[];
9
- }
10
- /**
11
- * Aggregate verdicts across multiple review slots (spec/quality/diff).
12
- * The final verdict is the most-severe across slots; concerns are unioned.
13
- *
14
- * Severity order: error > changes_required > concerns > annotated > approved > not_applicable/skipped.
15
- */
16
- export declare function aggregateReviews(slots: ReviewSlot[]): AggregatedReviews;
17
- //# sourceMappingURL=review-verdict-aggregator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"review-verdict-aggregator.d.ts","sourceRoot":"","sources":["../../src/review/review-verdict-aggregator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,aAAa,CAAC;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAYD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,iBAAiB,CAYvE"}
@@ -1,30 +0,0 @@
1
- const VERDICT_PRIORITY = {
2
- error: 5,
3
- changes_required: 4,
4
- concerns: 3,
5
- annotated: 2,
6
- approved: 1,
7
- not_applicable: 0,
8
- skipped: 0,
9
- };
10
- /**
11
- * Aggregate verdicts across multiple review slots (spec/quality/diff).
12
- * The final verdict is the most-severe across slots; concerns are unioned.
13
- *
14
- * Severity order: error > changes_required > concerns > annotated > approved > not_applicable/skipped.
15
- */
16
- export function aggregateReviews(slots) {
17
- let finalVerdict = 'not_applicable';
18
- const allConcerns = [];
19
- for (const slot of slots) {
20
- if ((VERDICT_PRIORITY[slot.verdict] ?? 0) > (VERDICT_PRIORITY[finalVerdict] ?? 0)) {
21
- finalVerdict = slot.verdict;
22
- }
23
- if (slot.concerns) {
24
- for (const c of slot.concerns)
25
- allConcerns.push(c);
26
- }
27
- }
28
- return { finalVerdict, allConcerns };
29
- }
30
- //# sourceMappingURL=review-verdict-aggregator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"review-verdict-aggregator.js","sourceRoot":"","sources":["../../src/review/review-verdict-aggregator.ts"],"names":[],"mappings":"AAYA,MAAM,gBAAgB,GAAkC;IACtD,KAAK,EAAE,CAAC;IACR,gBAAgB,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC;IACX,cAAc,EAAE,CAAC;IACjB,OAAO,EAAE,CAAC;CACX,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAmB;IAClD,IAAI,YAAY,GAAkB,gBAAgB,CAAC;IACnD,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAClF,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC;QAC9B,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ;gBAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IACD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AACvC,CAAC"}