@qianhaoq/dsh-dota2ai 0.2.7 → 0.2.8

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 (2) hide show
  1. package/lib/index.js +85 -48
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -12918,7 +12918,7 @@ import { join as join5 } from "node:path";
12918
12918
 
12919
12919
  // lib/agent/review/schema.js
12920
12920
  var DEEP_REVIEW_SCHEMA = "dota2.ai/deep-review@1";
12921
- var DEEP_REVIEW_PROMPT_VERSION = 76;
12921
+ var DEEP_REVIEW_PROMPT_VERSION = 77;
12922
12922
  var MAX_REFS = 3;
12923
12923
  var MAX_FINDINGS = 3;
12924
12924
  var MAX_HIGHLIGHTS = 4;
@@ -13006,15 +13006,15 @@ var SUBMIT_REVIEW = {
13006
13006
  type: "array",
13007
13007
  minItems: 2,
13008
13008
  maxItems: MAX_STORY,
13009
- description: "How the game came to its result, as a chain of causes in game order: each link a stretch of the game, what changed in it (gold, buildings, the chance to win, a lane), and because of what, with the records that show it. From the draft and the lanes to the turn and the end. The verdict sums this chain up in one sentence.",
13009
+ description: "Concise 1-sentence-per-phase causal backbone in game order (2\u20135 links; do not repeat full `chapters` prose): each link names a stretch, what changed (gold, buildings, lane), and because of what, backed by exact records. The verdict sums this chain up in one sentence.",
13010
13010
  items: {
13011
13011
  type: "object",
13012
13012
  additionalProperties: false,
13013
13013
  required: ["phase", "what_changed", "because", "whose", "evidence"],
13014
13014
  properties: {
13015
13015
  phase: { ...STR, description: 'The stretch, with its times: "0:00\u201310:00, the lane", "24:00\u201327:47, the turn".' },
13016
- what_changed: { ...STR, description: "What changed in it, with the tools' numbers: the gold lead, buildings, a lane's result." },
13017
- because: { ...STR, description: "Why, from the tools: where the gap came from, who came, who was where. Facts, not motives." },
13016
+ what_changed: { ...STR, description: "One concise sentence on what changed in this stretch, with the tools' numbers (gold lead, buildings, lane result)." },
13017
+ because: { ...STR, description: "One concise sentence on why, from the tools (where the gap came from, who joined, who was where). Facts, not motives." },
13018
13018
  whose: { type: "string", enum: STORY_WHOSE, description: "Whose doing this link mostly is, in your judgment: me (what the player controlled), team, enemy, draft, or unclear." },
13019
13019
  evidence: {
13020
13020
  type: "array",
@@ -13071,19 +13071,15 @@ var SUBMIT_REVIEW = {
13071
13071
  type: "object",
13072
13072
  additionalProperties: false,
13073
13073
  required: ["main_reason", "why"],
13074
- description: "Whole-game judgment beside `story` (do not repeat `story` chronology or findings): state `main_reason` and `why`, plus optional `strengths`, `line_ups`, and `against_your_plan` (only when the player stated a plan). Omit `course`, `your_part`, and `window` when `story` already covers them; attach `evidence` only for records not already cited in `story`.",
13074
+ description: "Whole-game judgment beside `chapters` and `story` (do not re-summarize draft, timeline, or findings): state only `main_reason` and `why`, plus `against_your_plan` ONLY when the opening message names the player's stated plan; attach `evidence` ONLY for records not already cited in `chapters`/`story`.",
13075
13075
  properties: {
13076
- line_ups: { ...STR, description: 'What lineup_timing shows: which heroes of each side win more in shorter or in longer public games, and which length this game had. One or two sentences; say "public games" and name the heroes. Leave out when it shows no lean on either side.' },
13077
- strengths: { ...STR, description: "Optional: what the player's hero was up against and when, from power_spikes (matchups in public/pro games, key level/item timings, and from which enemy item the kills came). Leave out what the tool has no data for." },
13078
- against_your_plan: { ...STR, description: "Only when the opening message says what the player's plan was: read the game against it (fit of items/play via build_for_plan & tempo_report, whether hero/window data supports it, and where it broke via farm_report/window_report). Leave out when the player did not state a plan." },
13079
- window: { ...STR, description: 'Optional (omit when `story` already covers the gold windows): peak lead window, buildings/fights taken, and enemy items finished near its end (never say an item "ended" the window).' },
13080
- course: { ...STR, description: "Optional (omit when `story` already covers the course of the game): summary of buildings and fights from tempo_report." },
13081
- your_part: { ...STR, description: "Optional (omit when `story` already covers the player's map presence): where the player spent time and which fights/buildings they joined." },
13076
+ against_your_plan: { ...STR, description: "ONLY when the opening message names the player's stated plan: read the game against it (fit of items/play via build_for_plan & tempo_report, whether hero/window data supports it, and where it broke via farm_report/window_report). Omit when the player did not state a plan." },
13082
13077
  main_reason: { type: "string", enum: PLAN_REASONS, description: "What the course of the game is mostly down to, in your judgment: your_play (the player's own play), team_play (the team's), enemy_play (what the enemy did), line_ups (the draft), unclear (the tools do not settle it)." },
13083
- why: { ...STR, description: "One or two sentences arguing main_reason from what the tools showed." },
13078
+ why: { ...STR, description: "One or two sentences arguing main_reason from what the tools showed, without repeating `chapters` or `story`." },
13084
13079
  evidence: {
13085
13080
  type: "array",
13086
13081
  maxItems: MAX_PLAN_EVIDENCE,
13082
+ description: "Optional: attach ONLY for records not already cited in `chapters`/`story`.",
13087
13083
  items: {
13088
13084
  type: "object",
13089
13085
  additionalProperties: false,
@@ -13096,7 +13092,6 @@ var SUBMIT_REVIEW = {
13096
13092
  }
13097
13093
  }
13098
13094
  },
13099
- did_well: { type: "array", items: STR, maxItems: 3 },
13100
13095
  encouragement: { ...STR, description: "1\u20132 sincere, specific closing sentences from the coach affirming the strengths already shown in this replay and building genuine confidence for future games." },
13101
13096
  blind_spots: { type: "array", items: STR, description: "What the replay data could not show for this review (from the tools' gaps)." }
13102
13097
  }
@@ -13149,18 +13144,19 @@ FIRST-PRINCIPLES DOTA 2 JUDGMENT
13149
13144
  - **Context-aware cast, build & macro evaluation**: Judge skill builds (\`skill_build\`), spells (\`hero_abilities\`, \`ability_audit\`, \`immunity_windows\`), items (\`build_check\`, \`pro_item_choices\`, \`my_economy\` / \`estimated_minutes_of_my_farm\`, \`player_already_held_for_this_purpose\`, \`most_built_in_this_bracket\` / \`public_items_in_this_bracket\`, \`most_built_by_pros_on_this_hero\`), and macro against THIS game's draft, economy, and timings \u2014 never just for deviating from a standard build or because a cast did not kill within 12 s (peeling, zoning, forcing BKB, stopping TPs are real value). A cast that damaged several enemies was not wasted because one was spell immune; an ability with \`casts_logged: false\` was never "0 casts". For supports, inspect \`ward_report\`, \`save_report\`, and \`my_rotations_before_10_00\` (a reference across all ranks is context, not a bracket average or quota).
13150
13145
  - **Fair attribution & emotional value**: In losses, clearly distinguish draft, team execution, and enemy tempo from what the player controlled \u2014 never charge the team's lost fights to a player who was not the cause. In EVERY game (win or loss), actively look for genuine positives (solid laning, standout \`me_in_fight\` damage/casts/saves, smart item/skill adaptation, composure in tough games) and praise them concretely with replay evidence. Write improvements in a collaborative "here is a sharper play next time" tone \u2014 never scolding, never mechanical KPI quotas.
13151
13146
 
13152
- STRUCTURE OF \`submit_review\`
13153
- - \`verdict\`: one crisp, balanced sentence summing up the game (at most 1\u20132 key numbers).
13154
- - \`opening_note\`: 2\u20133 sincere, grounded coach sentences contextualizing this game fairly (celebrating a win warmly or separating non-player factors in a loss).
13155
- - \`highlights\` (1\u2013${MAX_HIGHLIGHTS}): concrete, evidence-backed positives (optional \`evidence\` refs so the player can replay their highlight on the minimap).
13156
- - \`chapters\` (2\u2013${MAX_CHAPTERS}): adaptive breakdown across the dimensions that mattered (\`draft_and_lanes\`, \`laning\`, \`skill_build\`, \`items\`, \`teamfights\`, \`macro\`, \`other\`), each with \`assessment\` (\`praise\` / \`solid\` / \`mixed\` / \`key_gap\`), authentic coaching \`analysis\`, cited \`evidence\`, and optional \`takeaway\` ONLY when real room to improve exists (omit for \`praise\`/\`solid\`).
13157
- - \`story\` (2\u20136 causal links in game order) and \`game_plan\` (\`main_reason\` + \`why\`, plus optional \`strengths\`, \`line_ups\`, and \`against_your_plan\` ONLY when the opening message names the player's stated plan, using \`build_for_plan\`).
13147
+ STRUCTURE OF \`submit_review\` (no duplication across sections)
13148
+ - \`verdict\`: one crisp, balanced sentence summing up the game (1\u20132 key numbers max).
13149
+ - \`opening_note\`: 2\u20133 grounded coach sentences contextualizing this game (celebrate wins warmly or separate non-player factors in losses).
13150
+ - \`highlights\` (1\u2013${MAX_HIGHLIGHTS}): concrete, evidence-backed positives (optional \`evidence\` refs for minimap replay).
13151
+ - \`chapters\` (2\u2013${MAX_CHAPTERS}): carry the coaching analysis per dimension (\`draft_and_lanes\`, \`laning\`, \`skill_build\`, \`items\`, \`teamfights\`, \`macro\`, \`other\`), each with \`assessment\` (\`praise\`/\`solid\`/\`mixed\`/\`key_gap\`), \`analysis\`, \`evidence\`, and optional \`takeaway\` ONLY when real room to improve exists (omit for \`praise\`/\`solid\`).
13152
+ - \`story\` (2\u20135 links, 1 sentence per phase in game order): compact causal backbone \u2014 do not repeat \`chapters\` prose.
13153
+ - \`game_plan\`: only \`main_reason\` + \`why\` (+ \`against_your_plan\` ONLY if the opening message names a stated plan, using \`build_for_plan\`; optional \`evidence\` ONLY for records not cited in \`chapters\`/\`story\`) \u2014 never re-summarize draft or timeline already in \`chapters\`/\`story\`.
13158
13154
  - \`findings\` (0\u2013${MAX_FINDINGS}, ordered by what mattered most to this player): only high-leverage, player-controlled improvements (omit or keep concise in clean wins; link \`story_link\`; optional \`rule\` with \`when\`/\`do\`/optional \`this_game\` only for recurring decisions).
13159
- - \`encouragement\`: 1\u20132 sincere, specific closing sentences affirming the strengths already shown in this replay.
13155
+ - \`encouragement\`: 1\u20132 sincere closing sentences affirming the strengths shown in this replay.
13160
13156
 
13161
13157
  VERIFICATION & HONESTY RULES (enforced by code)
13162
- - **Facts & numbers**: every clock time (m:ss) and every number you state about the game must come verbatim from a tool result in this conversation \u2014 never add, subtract, or average. Use counts a tool directly states (\`killed_by\`, \`by_target\`, \`*_total\`, \`deaths_where\`, \`damage_share_in_death_windows\`).
13163
- - **Evidence refs**: every evidence item cites 1\u20133 exact \`ref\` strings from this conversation and states ONLY what those cited records contain. Tool summary counts belong to top-level summary refs (\`deaths:<hero>\`, \`audit:<hero>:<ability>\`, \`fights:<hero>\`, \`build:<hero>\`, \`overview\`). Never join a fact from one record to a different moment.
13158
+ - **Facts & numbers**: every clock time (m:ss) and number about the game must come verbatim from a tool result in this conversation \u2014 never add, subtract, or average. Use counts a tool states (\`killed_by\`, \`by_target\`, \`*_total\`, \`deaths_where\`, \`damage_share_in_death_windows\`).
13159
+ - **Evidence refs (summary vs child)**: each evidence item cites 1\u20133 exact \`ref\` strings and states ONLY what those records hold. Summary refs (\`deaths:<hero>\`, \`fights:<hero>\`, \`audit:<hero>:<ability>\`, \`tempo:<hero>\`, \`decision:<hero>\`, \`sieges:<hero>\`, \`roshan:<hero>\`, \`window:<hero>\`, \`overview\`) ONLY cover top-level counts/totals \u2014 NEVER individual event clocks, damage, or stun durations. Per-event details MUST cite the child record's exact \`ref\`: \`cast:<hero>:<ability>:<n>\` (single cast clock/stun/damage), \`death:<hero>:<n>\` (single death), \`fights:<hero>:<n>\` (single fight clock/damage/participants), \`phase:<hero>:<n>\` (10-min phase), \`decision:<hero>:<n>\`, \`sieges:<hero>:<n>\`, \`roshan:<hero>:<n>\`. Never join a fact from one record to a different moment.
13164
13160
  - **Never claim vision / fog of war**: replays have no vision data. Wards (\`observers_within_1600\`, \`ward_report\`) show placement, never who saw whom. Never say a player "had no vision", "did not see", or died "because of a ward". A rule's \`when\` must use only what is guaranteed on the player's own screen (own HP/mana, items/gold, clock, allies near, enemy heroes missing from the minimap, an ability an enemy just used) \u2014 never enemies seen approaching or walking toward the player.
13165
13161
  - **Read choices, not minds**: state actions, positions, and distances \u2014 never motives ("intended", "wanted", "refused", "ignored the call"). Say a hero was "farming" only when a tool reports \`doing: "farming"\`. Never state what an ability or item does from memory (always check \`hero_abilities\` / \`build_check\`; never assume spell immunity stops an ability the tools show pierced it).
13166
13162
  - **Respect tool semantics**: never quote \`key_moments\` win-chance percentages (they only rank moments, never assign fault); never say a \`save_report\` cast "saved" or "failed to save" an ally; in \`decision_points\`, "neither" means the team did not take a building/Roshan (not that it "did nothing"); in \`siege_report\`, \`owners_near\` does not prove defending and other heroes' positions are at push start (use \`me_when_it_fell\` or \`game_state\` for when it fell); in \`roshan_report\`, \`aegis_pickups_only\` never proves a side took no Roshan; in \`window_report\`, never say an item "closed/ended" a window; in \`lineup_timing\`, per-hero win rates are not a lineup win rate; quote pro vs public bracket samples accurately with their label and release/patch.
@@ -21310,22 +21306,27 @@ function collectFacts(sources) {
21310
21306
  }
21311
21307
  if (span && own) out.moments.push({ from: span[0], to: span[1], numbers: own });
21312
21308
  };
21313
- const cite = (value) => {
21309
+ const cite = (value, summaryParent = null) => {
21314
21310
  if (Array.isArray(value)) {
21315
- for (const v of value) cite(v);
21311
+ for (const v of value) cite(v, summaryParent);
21316
21312
  return;
21317
21313
  }
21318
21314
  if (!value || typeof value !== "object") return;
21315
+ let nextParent = summaryParent;
21319
21316
  if (typeof value.ref === "string") {
21320
- const inner = value.ref_scope === "summary" ? summaryFactsOf(value) : collectFactsOf(value);
21317
+ const isSummary = value.ref_scope === "summary";
21318
+ const inner = isSummary ? summaryFactsOf(value) : collectFactsOf(value);
21321
21319
  const at = typeof value.t === "number" ? value.t : typeof value.from === "number" ? value.from : typeof value.first_held?.t === "number" ? value.first_held.t : null;
21322
- const r = out.refs.get(value.ref) ?? { at, times: /* @__PURE__ */ new Set(), numbers: /* @__PURE__ */ new Set() };
21320
+ const r = out.refs.get(value.ref) ?? { at, times: /* @__PURE__ */ new Set(), numbers: /* @__PURE__ */ new Set(), scope: isSummary ? "summary" : "record", children: /* @__PURE__ */ new Set() };
21323
21321
  for (const t6 of inner.times) r.times.add(t6);
21324
21322
  for (const n of inner.numbers) r.numbers.add(n);
21325
21323
  if (r.at == null) r.at = at;
21324
+ if (!isSummary && r.scope === "summary") r.scope = "record";
21326
21325
  out.refs.set(value.ref, r);
21326
+ if (summaryParent && summaryParent !== value.ref) out.refs.get(summaryParent)?.children.add(value.ref);
21327
+ nextParent = isSummary ? value.ref : null;
21327
21328
  }
21328
- for (const v of Object.values(value)) cite(v);
21329
+ for (const v of Object.values(value)) cite(v, nextParent);
21329
21330
  };
21330
21331
  for (const src of [].concat(sources ?? [])) {
21331
21332
  walk(src, null);
@@ -21487,17 +21488,52 @@ var has = (set, n, slack) => {
21487
21488
  return false;
21488
21489
  };
21489
21490
  var percentOk = (set, n) => has(set, n.value / 100, 6e-3) || n.value >= 1 && has(set, n.value, 0.5);
21491
+ var bigOk = (n, set) => has(set, n.value, n.approx ? n.value * 0.06 : 1);
21492
+ var timeInSet = (times, clock10) => {
21493
+ const t6 = clockToSeconds(clock10);
21494
+ if (t6 == null) return false;
21495
+ for (let d = -CLOCK_TOLERANCE; d <= CLOCK_TOLERANCE; d += 1) if (times.has(t6 + d)) return true;
21496
+ return false;
21497
+ };
21498
+ var numberInEvidence = (local, n) => n.percent ? percentOk(local, n) : n.value >= BIG ? bigOk(n, local) : n.value > TRIVIAL || n.decimal ? has(local, n.value, n.decimal ? 0.05 : 0.5) : false;
21499
+ var MOMENT_PROBLEM = /^(.+?)\s+\(not in ([^)]+)\)$/;
21500
+ function suggestChildRefs(problem, sources = [], knownRefs = null) {
21501
+ if (!problem || problem.kind !== "moment" || typeof problem.text !== "string") return [];
21502
+ const m = MOMENT_PROBLEM.exec(problem.text);
21503
+ if (!m) return [];
21504
+ const rawVal = m[1].trim();
21505
+ const citedRefs = m[2].split(",").map((s) => s.trim()).filter(Boolean);
21506
+ if (!rawVal || !citedRefs.length) return [];
21507
+ const isClock = clockToSeconds(rawVal) != null;
21508
+ const num = isClock ? null : statedFacts(rawVal).numbers[0] ?? null;
21509
+ if (!isClock && !num) return [];
21510
+ const hasMeta = knownRefs instanceof Map && citedRefs.some((r) => knownRefs.get(r)?.children instanceof Set);
21511
+ const refsMap = hasMeta ? knownRefs : collectFacts(sources).refs;
21512
+ const citedSet = new Set(citedRefs);
21513
+ const out = [];
21514
+ const seen = /* @__PURE__ */ new Set();
21515
+ for (const ref of citedRefs) {
21516
+ const entry = refsMap.get(ref);
21517
+ if (!entry || entry.scope !== "summary" || !(entry.children instanceof Set) || !entry.children.size) continue;
21518
+ for (const childRef of entry.children) {
21519
+ if (seen.has(childRef) || citedSet.has(childRef)) continue;
21520
+ const child = refsMap.get(childRef);
21521
+ if (!child || child.scope === "summary") continue;
21522
+ const matches = isClock ? timeInSet(child.times, rawVal) : numberInEvidence(child.numbers, num);
21523
+ if (matches) {
21524
+ seen.add(childRef);
21525
+ out.push(childRef);
21526
+ if (out.length >= 3) return out;
21527
+ }
21528
+ }
21529
+ }
21530
+ return out;
21531
+ }
21490
21532
  function verifyReview(review, sources, accepted = []) {
21491
21533
  const listOf2 = (v) => Array.isArray(v) ? v : [];
21492
21534
  const known = collectFacts(sources);
21493
21535
  for (const text of listOf2(accepted)) for (const n of statedFacts(text).numbers) if (n.counted && !n.decimal) known.summary.add(n.value);
21494
- const timeOk = (clock10) => {
21495
- const t6 = clockToSeconds(clock10);
21496
- if (t6 == null) return false;
21497
- for (let d = -CLOCK_TOLERANCE; d <= CLOCK_TOLERANCE; d += 1) if (known.times.has(t6 + d)) return true;
21498
- return false;
21499
- };
21500
- const bigOk = (n, set) => has(set, n.value, n.approx ? n.value * 0.06 : 1);
21536
+ const timeOk = (clock10) => timeInSet(known.times, clock10);
21501
21537
  const problems = [];
21502
21538
  const notes = [];
21503
21539
  const names2 = [].concat(sources ?? []).find((s) => s && typeof s === "object" && !Array.isArray(s) && s.hero_names) ?? {};
@@ -21559,23 +21595,14 @@ function verifyReview(review, sources, accepted = []) {
21559
21595
  for (const t6 of c.times) times.add(t6);
21560
21596
  for (const n of c.numbers) local.add(n);
21561
21597
  }
21562
- const inRecord = (clock10) => {
21563
- const t6 = clockToSeconds(clock10);
21564
- if (t6 == null) return false;
21565
- for (let d = -CLOCK_TOLERANCE; d <= CLOCK_TOLERANCE; d += 1) if (times.has(t6 + d)) return true;
21566
- return false;
21567
- };
21598
+ const inRecord = (clock10) => timeInSet(times, clock10);
21568
21599
  const fact = typeof e?.fact === "string" ? e.fact : "";
21569
21600
  const stated = statedFacts(fact);
21570
21601
  wording(where2, index3, fact);
21571
21602
  for (const s of sightClaims(fact)) problems.push({ where: where2, index: index3, kind: "sight", text: s });
21572
21603
  for (const c of new Set(stated.times)) if (!inRecord(c)) problems.push({ where: where2, index: index3, kind: "moment", text: `${c} (not in ${refs.join(", ")})` });
21573
21604
  for (const n of stated.numbers) {
21574
- if (n.percent) {
21575
- if (!percentOk(local, n)) problems.push({ where: where2, index: index3, kind: "moment", text: `${n.text} (not in ${refs.join(", ")})` });
21576
- } else if (n.value >= BIG) {
21577
- if (!bigOk(n, local)) problems.push({ where: where2, index: index3, kind: "moment", text: `${n.text} (not in ${refs.join(", ")})` });
21578
- } else if ((n.value > TRIVIAL || n.decimal) && !has(local, n.value, n.decimal ? 0.05 : 0.5)) problems.push({ where: where2, index: index3, kind: "moment", text: `${n.text} (not in ${refs.join(", ")})` });
21605
+ if ((n.percent || n.value >= BIG || n.value > TRIVIAL || n.decimal) && !numberInEvidence(local, n)) problems.push({ where: where2, index: index3, kind: "moment", text: `${n.text} (not in ${refs.join(", ")})` });
21579
21606
  }
21580
21607
  };
21581
21608
  prose2("verdict", 0, review?.verdict);
@@ -23251,7 +23278,7 @@ var REPAIR_HELP = {
23251
23278
  time: "this time is not in any tool result",
23252
23279
  number: "this number is not in any tool result",
23253
23280
  count: "no tool gave this count; use the count a tool states (killed_by, by_target, *_total)",
23254
- moment: "the cited record does not hold this; cite the record that does, or remove it",
23281
+ moment: "the cited record does not hold this (summary refs only cover top-level totals, not individual events); if suggested_refs are listed, verify and cite the specific child ref(s), or remove the unsupported detail",
23255
23282
  ref: "no tool record with this ref was returned in this conversation; copy a ref exactly",
23256
23283
  missing: "this finding has no title: give it a heading of a few words",
23257
23284
  language: "write this in the language of the rest of the review",
@@ -23384,6 +23411,16 @@ ${JSON.stringify(context)}`;
23384
23411
  const midRepair = from?.first && from.run ? from.run : null;
23385
23412
  if (!midRepair) save(done, null);
23386
23413
  const placeOf = (p) => p.where === "findings" ? "findings" : p.where === "game_plan" ? "game_plan" : p.where === "plan" ? `game_plan.${PLAN_TEXTS[p.index]}` : p.where === "plan_evidence" ? `game_plan.evidence ${p.index + 1}` : p.where === "story" ? `story ${p.index + 1}` : p.where === "story_evidence" ? `story ${p.index + 1}, evidence ${(p.item ?? 0) + 1}` : p.where === "highlight" ? `highlight ${p.index + 1}` : p.where === "highlight_evidence" ? `highlight ${p.index + 1}, evidence ${(p.item ?? 0) + 1}` : p.where === "chapter" ? `chapter ${p.index + 1}` : p.where === "chapter_evidence" ? `chapter ${p.index + 1}, evidence ${(p.item ?? 0) + 1}` : p.where === "finding" ? `finding ${p.index + 1}` : p.where === "title" ? `finding ${p.index + 1}, title` : p.where === "rule" ? `finding ${p.index + 1}, rule.this_game` : `${p.where}${p.where === "verdict" || p.where === "opening_note" || p.where === "encouragement" ? "" : ` ${p.index + 1}`}`;
23414
+ const repairSources = sources();
23415
+ const formatProblem = (p) => {
23416
+ const suggested = p.kind === "moment" ? suggestChildRefs(p, repairSources, check.refs) : [];
23417
+ return {
23418
+ in: placeOf(p),
23419
+ text: p.text,
23420
+ why: REPAIR_HELP[p.kind],
23421
+ ...suggested.length ? { suggested_refs: suggested } : {}
23422
+ };
23423
+ };
23387
23424
  const second = await runAgent({
23388
23425
  ...base,
23389
23426
  ...midRepair ? { resume: resumed(midRepair) } : {},
@@ -23392,7 +23429,7 @@ ${JSON.stringify(context)}`;
23392
23429
  messages: midRepair ? midRepair.messages : [...first.messages, ...first.messages.at(-1).tool_calls.map((c) => ({
23393
23430
  role: "tool",
23394
23431
  tool_call_id: c.id,
23395
- content: c === lastCall ? JSON.stringify({ error: "unsupported_facts", detail: "Look each one up with a tool, or rewrite the sentence without it, then call submit_review again with the whole review.", problems: check.problems.map((p) => ({ in: placeOf(p), text: p.text, why: REPAIR_HELP[p.kind] })) }) : JSON.stringify({ error: "not_run" })
23432
+ content: c === lastCall ? JSON.stringify({ error: "unsupported_facts", detail: "Look each one up with a tool, or rewrite the sentence without it, then call submit_review again with the whole review.", problems: check.problems.map(formatProblem) }) : JSON.stringify({ error: "not_run" })
23396
23433
  }))]
23397
23434
  });
23398
23435
  add(second);
@@ -25457,7 +25494,7 @@ function shapeReview(matchId, hero, lang, state) {
25457
25494
  ...typeof r.encouragement === "string" && r.encouragement.trim() ? { encouragement: r.encouragement } : {},
25458
25495
  blind_spots: list(r.blind_spots),
25459
25496
  checked: { against: "replay records", removed_for_lack_of_evidence: state.verification?.dropped ?? 0 },
25460
- note: "Times and numbers were checked against the replay. Quote them as given, say what the review cannot see (blind_spots), and link the url: it has every piece of evidence and a coach to ask."
25497
+ note: "Times and numbers were checked against the replay. Present in a warm, constructive coach tone (verdict + opening_note, concrete highlights, key chapters/findings, encouragement) with zero mechanical next-game KPI quotas. Quote times and numbers as given, say what the review cannot see (blind_spots), and link the url: it has every piece of evidence and a coach to ask."
25461
25498
  };
25462
25499
  }
25463
25500
  var OWN_MODEL = "To review now on your own model instead, install the dota2.ai plugin for DeepSeek Harness (DSH): https://dota2.ai/#ways-dsh";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qianhaoq/dsh-dota2ai",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "dota2.ai for DSH: standalone replay review page, DSH host-model agent, coach tools and skill",
5
5
  "icon": "./icon.svg",
6
6
  "homepage": "https://dota2.ai",