@qianhaoq/dsh-dota2ai 0.2.6 → 0.2.7

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 (3) hide show
  1. package/lib/client.js +71 -8
  2. package/lib/index.js +211 -17
  3. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -25733,9 +25733,6 @@ function deathsToGapClosers(deaths, slotOfHero, spikes, gap = GAP) {
25733
25733
  });
25734
25734
  }
25735
25735
  var HABITS = {
25736
- low_health: { from: "deaths", at: ["deaths_where", "health_below_half_at_window_start"], unsure: "health_at_window_start", label: () => t("deaths that began below half health (12 s before)", "\u6B7B\u524D 12 \u79D2\u5DF2\u4E0D\u5230\u534A\u8840\u7684\u9635\u4EA1", "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0441 \u043C\u0435\u043D\u0435\u0435 \u0447\u0435\u043C \u043F\u043E\u043B\u043E\u0432\u0438\u043D\u043E\u0439 HP (\u0437\u0430 12 \u0441 \u0434\u043E \u0441\u043C\u0435\u0440\u0442\u0438)") },
25737
- // Low health, and outnumbered, outside the game's fights only: for a hero whose job is to be in them, that is where the habit shows.
25738
- low_health_outside_fights: { from: "deaths", at: ["deaths_where", "health_below_half_at_window_start_outside_fights"], unsure: "health_below_half_at_window_start_outside_fights", label: () => t("deaths outside fights that began below half health (12 s before)", "\u56E2\u6218\u4E4B\u5916\u3001\u6B7B\u524D 12 \u79D2\u5DF2\u4E0D\u5230\u534A\u8840\u7684\u9635\u4EA1", "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0432\u043D\u0435 \u0434\u0440\u0430\u043A \u0441 \u043C\u0435\u043D\u0435\u0435 \u0447\u0435\u043C \u043F\u043E\u043B\u043E\u0432\u0438\u043D\u043E\u0439 HP (\u0437\u0430 12 \u0441)") },
25739
25736
  outnumbered_outside_fights: { from: "deaths", at: ["deaths_where", "three_or_more_enemy_heroes_dealing_damage_outside_fights"], unsure: "three_or_more_enemy_heroes_dealing_damage_outside_fights", label: () => t("deaths outside fights to three or more enemy heroes", "\u56E2\u6218\u4E4B\u5916\u88AB\u4E09\u4E2A\u4EE5\u4E0A\u654C\u65B9\u82F1\u96C4\u56F4\u6740\u7684\u9635\u4EA1", "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0432\u043D\u0435 \u0434\u0440\u0430\u043A \u043E\u0442 \u0442\u0440\u0451\u0445 \u0438 \u0431\u043E\u043B\u0435\u0435 \u0432\u0440\u0430\u0433\u043E\u0432") },
25740
25737
  outnumbered: { from: "deaths", at: ["deaths_where", "three_or_more_enemy_heroes_dealing_damage"], unsure: null, label: () => t("deaths to three or more enemy heroes", "\u88AB\u4E09\u4E2A\u4EE5\u4E0A\u654C\u65B9\u82F1\u96C4\u56F4\u6740\u7684\u9635\u4EA1", "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u043E\u0442 \u0442\u0440\u0451\u0445 \u0438 \u0431\u043E\u043B\u0435\u0435 \u0432\u0440\u0430\u0433\u043E\u0432") },
25741
25738
  nothing_pressed: { from: "deaths", at: ["deaths_where", "nothing_cast_and_no_item_used"], unsure: null, label: () => t("deaths with nothing cast or used", "\u4EC0\u4E48\u90FD\u6CA1\u6309\u7684\u9635\u4EA1", "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0431\u0435\u0437 \u0435\u0434\u0438\u043D\u043E\u0439 \u043D\u0430\u0436\u0430\u0442\u043E\u0439 \u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u0438\u043B\u0438 \u043F\u0440\u0435\u0434\u043C\u0435\u0442\u0430") },
@@ -25746,7 +25743,7 @@ var HABITS = {
25746
25743
  died_holding: { from: "audit", at: ["deaths_with_it_ready_and_not_cast_total"], unsure: null, label: (n) => t(`deaths with ${n.en} ready and not cast`, `${n.zh}\u5C31\u7EEA\u5374\u6CA1\u653E\u7684\u9635\u4EA1`, `\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0441 \u0433\u043E\u0442\u043E\u0432\u044B\u043C, \u043D\u043E \u043D\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u043D\u044B\u043C ${n.en}`) }
25747
25744
  };
25748
25745
  var HABIT_KEYS = Object.keys(HABITS);
25749
- var RETIRED_HABITS = Object.freeze(["alone", "alone_not_traded"]);
25746
+ var RETIRED_HABITS = Object.freeze(["alone", "alone_not_traded", "low_health", "low_health_outside_fights"]);
25750
25747
  var MIN_MINUTES = 10;
25751
25748
  function countIn(h, summary) {
25752
25749
  const v = h.at.length === 2 ? summary?.[h.at[0]]?.[h.at[1]] : summary?.[h.at[0]];
@@ -25761,6 +25758,13 @@ function habitRef(goal, hero) {
25761
25758
  }
25762
25759
  function evaluateHabit(goal, summary, minutes) {
25763
25760
  const out = (result2, evidence, count) => ({ result: result2, evidence, ...Number.isInteger(count) ? { count } : {} });
25761
+ if (goal?.habit === "low_health" || goal?.habit === "low_health_outside_fights") {
25762
+ return out("unknown", t(
25763
+ "This goal is no longer counted: low HP 12 s before death alone does not capture both sides' kill threat. Pick another goal.",
25764
+ "\u8FD9\u4E2A\u76EE\u6807\u5DF2\u4E0D\u518D\u7EDF\u8BA1\uFF1A\u53EA\u770B\u6B7B\u524D 12 \u79D2\u662F\u5426\u4E0D\u5230\u534A\u8840\u65E0\u6CD5\u53CD\u6620\u53CC\u65B9\u771F\u5B9E\u7684\u51FB\u6740\u5A01\u80C1\u3002\u8BF7\u6362\u4E00\u4E2A\u76EE\u6807\u3002",
25765
+ "\u042D\u0442\u0430 \u0446\u0435\u043B\u044C \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F: \u043D\u0438\u0437\u043A\u043E\u0435 HP \u0437\u0430 12 \u0441 \u0434\u043E \u0441\u043C\u0435\u0440\u0442\u0438 \u0441\u0430\u043C\u043E \u043F\u043E \u0441\u0435\u0431\u0435 \u043D\u0435 \u043E\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0440\u0435\u0430\u043B\u044C\u043D\u0443\u044E \u0443\u0433\u0440\u043E\u0437\u0443 \u0443\u0431\u0438\u0439\u0441\u0442\u0432\u0430 \u043E\u0431\u0435\u0438\u0445 \u0441\u0442\u043E\u0440\u043E\u043D. \u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0443\u044E \u0446\u0435\u043B\u044C."
25766
+ ));
25767
+ }
25764
25768
  if (RETIRED_HABITS.includes(goal?.habit)) return out("unknown", t("This goal is no longer counted: deaths with no ally nearby said little about a decision. Pick another goal.", "\u8FD9\u4E2A\u76EE\u6807\u5DF2\u4E0D\u518D\u7EDF\u8BA1\uFF1A\u8EAB\u8FB9\u6709\u6CA1\u6709\u961F\u53CB\u8BF4\u660E\u4E0D\u4E86\u51B3\u7B56\u5BF9\u9519\u3002\u8BF7\u6362\u4E00\u4E2A\u76EE\u6807\u3002", "\u042D\u0442\u0430 \u0446\u0435\u043B\u044C \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F: \u043D\u0430\u043B\u0438\u0447\u0438\u0435 \u0441\u043E\u044E\u0437\u043D\u0438\u043A\u043E\u0432 \u0440\u044F\u0434\u043E\u043C \u043C\u0430\u043B\u043E \u0433\u043E\u0432\u043E\u0440\u0438\u0442 \u043E \u0440\u0435\u0448\u0435\u043D\u0438\u0438. \u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0443\u044E \u0446\u0435\u043B\u044C."));
25765
25769
  const h = HABITS[goal?.habit];
25766
25770
  if (!h || !Number.isFinite(goal.max) || h.from === "audit" && !(goal.name?.en && goal.name?.zh)) return out("unknown", t("Unknown goal.", "\u65E0\u6CD5\u8BC6\u522B\u7684\u76EE\u6807\u3002", "\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0446\u0435\u043B\u044C."));
@@ -27591,6 +27595,14 @@ var T9 = {
27591
27595
  laneVisits: { en: "Came into the lane", zh: "\u522B\u8DEF\u6765\u672C\u8DEF\u4EA4\u624B", ru: "\u041F\u0440\u0438\u0448\u043B\u0438 \u043D\u0430 \u043B\u0438\u043D\u0438\u044E" },
27592
27596
  laneVisitDied: { en: "died", zh: "\u9635\u4EA1", ru: "\u043F\u043E\u0433\u0438\u0431\u043B\u0438" },
27593
27597
  laneRotations: { en: "Left lane before 10:00 (20 s+)", zh: "10 \u5206\u949F\u524D\u79BB\u8DEF\u6E38\u8D70\uFF0820 \u79D2\u4EE5\u4E0A\uFF09", ru: "\u0423\u0445\u043E\u0434\u044B \u0441 \u043B\u0438\u043D\u0438\u0438 \u0434\u043E 10:00 (20 \u0441+)" },
27598
+ laneRoaming: { en: "Roaming before 10:00 (no single lane)", zh: "10 \u5206\u949F\u524D\u6E38\u8D70\uFF08\u65E0\u5355\u4E00\u56FA\u5B9A\u5206\u8DEF\uFF09", ru: "\u0420\u043E\u0443\u043C\u0438\u043D\u0433 \u0434\u043E 10:00 (\u0431\u0435\u0437 \u043E\u0434\u043D\u043E\u0439 \u043B\u0438\u043D\u0438\u0438)" },
27599
+ laneTimeByThird: { en: "Time before 10:00 by lane", zh: "10 \u5206\u949F\u524D\u5404\u8DEF\u505C\u7559\u65F6\u95F4", ru: "\u0412\u0440\u0435\u043C\u044F \u043F\u043E \u043B\u0438\u043D\u0438\u044F\u043C \u0434\u043E 10:00" },
27600
+ laneBase: { en: "base", zh: "\u57FA\u5730", ru: "\u0431\u0430\u0437\u0430" },
27601
+ laneNotKnown: { en: "not known", zh: "\u7F3A\u5931\u91C7\u6837", ru: "\u043D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" },
27602
+ laneRoamTrips: { en: "Roaming trips before 10:00 (20 s+)", zh: "10 \u5206\u949F\u524D\u5404\u8DEF\u6E38\u8D70\u65F6\u6BB5\uFF0820 \u79D2\u4EE5\u4E0A\uFF09", ru: "\u0412\u044B\u0445\u043E\u0434\u044B \u043D\u0430 \u043B\u0438\u043D\u0438\u0438 \u0434\u043E 10:00 (20 \u0441+)" },
27603
+ laneRoamTraded: { en: "traded damage", zh: "\u4EA4\u624B\u6362\u8840", ru: "\u0440\u0430\u0437\u043C\u0435\u043D \u0443\u0440\u043E\u043D\u043E\u043C" },
27604
+ laneRoamEnemyDied: { en: "enemy died", zh: "\u654C\u65B9\u9635\u4EA1", ru: "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0432\u0440\u0430\u0433\u043E\u0432" },
27605
+ laneRoamAllyDied: { en: "ally died", zh: "\u961F\u53CB\u9635\u4EA1", ru: "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0441\u043E\u044E\u0437\u043D\u0438\u043A\u043E\u0432" },
27594
27606
  lanePartnerDied: { en: "lane partner died", zh: "\u672C\u8DEF\u961F\u53CB\u9635\u4EA1", ru: "\u043F\u0430\u0440\u0442\u043D\u0451\u0440 \u043F\u043E \u043B\u0438\u043D\u0438\u0438 \u043F\u043E\u0433\u0438\u0431" },
27595
27607
  lanePartTime: { en: "Shared the lane part-time", zh: "\u517C\u987E\u672C\u8DEF", ru: "\u0414\u0435\u043B\u0438\u043B\u0438 \u043B\u0438\u043D\u0438\u044E \u0447\u0430\u0441\u0442\u0438\u0447\u043D\u043E" },
27596
27608
  laneRoster: { en: "Read over", zh: "\u7EDF\u8BA1\u8303\u56F4", ru: "\u041F\u043E \u0433\u0435\u0440\u043E\u044F\u043C" },
@@ -27896,11 +27908,9 @@ var TOTALS = {
27896
27908
  damage_share_in_death_windows: { en: "Share of it", zh: "\u5176\u4E2D" },
27897
27909
  attacks: { en: "attacks", zh: "\u666E\u901A\u653B\u51FB" },
27898
27910
  "abilities and items": { en: "abilities and items", zh: "\u6280\u80FD\u548C\u7269\u54C1" },
27899
- health_below_half_at_window_start: { en: "Deaths that began below half health", zh: "\u8D77\u6B65\u4E0D\u5230\u534A\u8840\u7684\u9635\u4EA1" },
27900
27911
  three_or_more_enemy_heroes_dealing_damage: { en: "Deaths to three or more enemy heroes", zh: "\u88AB\u4E09\u4E2A\u4EE5\u4E0A\u654C\u65B9\u82F1\u96C4\u6253\u6B7B" },
27901
27912
  in_a_fight: { en: "Deaths in a fight", zh: "\u56E2\u6218\u4E2D\u7684\u9635\u4EA1" },
27902
27913
  outside_fights: { en: "Deaths outside fights", zh: "\u56E2\u6218\u4E4B\u5916\u7684\u9635\u4EA1" },
27903
- health_below_half_at_window_start_outside_fights: { en: "Outside fights, began below half health", zh: "\u56E2\u6218\u4E4B\u5916\u3001\u8D77\u6B65\u4E0D\u5230\u534A\u8840" },
27904
27914
  three_or_more_enemy_heroes_dealing_damage_outside_fights: { en: "Outside fights, to three or more enemy heroes", zh: "\u56E2\u6218\u4E4B\u5916\u3001\u88AB\u4E09\u4E2A\u4EE5\u4E0A\u654C\u65B9\u82F1\u96C4\u6253\u6B7B" },
27905
27915
  target_spell_immune_and_not_stunned: { en: "Casts on a spell-immune target, no stun", zh: "\u653E\u7ED9\u9B54\u514D\u76EE\u6807\u4E14\u6CA1\u6655\u4F4F" },
27906
27916
  enemy_hero_target_alive_12s_later: { en: "Casts whose target was alive 12 s later", zh: "\u653E\u51FA 12 \u79D2\u540E\u76EE\u6807\u4ECD\u5B58\u6D3B" },
@@ -28557,7 +28567,7 @@ function Record({ data: data2, lang }) {
28557
28567
  " \xB7 ",
28558
28568
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: t2(T9.laneResult[r.lane_result]) })
28559
28569
  ] }) : null
28560
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "ag-rec-note", children: t2(T9.laneNoEconomy) }),
28570
+ ] }) : r.how_the_lane_went?.roaming_before_10_00 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "ag-rec-head", children: t2(T9.laneRoaming) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "ag-rec-note", children: t2(T9.laneNoEconomy) }),
28561
28571
  r.lane && r.read_from === "replay" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "ag-rec-note", children: t2(T9.laneFromReplay) }),
28562
28572
  r.lane && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ag-lane-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("table", { className: "ag-lane", children: [
28563
28573
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tr", { children: T9.laneCols[lang].map((c) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("th", { scope: "col", children: c }, c)) }) }),
@@ -28630,6 +28640,58 @@ function Record({ data: data2, lang }) {
28630
28640
  Array.isArray(tr.enemy_deaths_i_damaged) && tr.enemy_deaths_i_damaged.length > 0 ? ` \xB7 ${t2(T9.laneVisitDied)} ${tr.enemy_deaths_i_damaged.map((x) => N(x.hero)).join(", ")}` : "",
28631
28641
  Array.isArray(tr.lane_partner_deaths_while_away) && tr.lane_partner_deaths_while_away.length > 0 ? ` \xB7 ${t2(T9.lanePartnerDied)} ${tr.lane_partner_deaths_while_away.map((x) => N(x.hero)).join(", ")}` : ""
28632
28642
  ] }, i))
28643
+ ] }),
28644
+ w.roaming_before_10_00 && w.my_lane_seconds_by_third && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-line", children: [
28645
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: t2(T9.laneTimeByThird) }),
28646
+ ["top", "mid", "bot"].map((k2) => typeof w.my_lane_seconds_by_third[k2] === "number" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip", children: [
28647
+ t2(T9.lane[k2]),
28648
+ " ",
28649
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
28650
+ w.my_lane_seconds_by_third[k2],
28651
+ t2(T9.sec)
28652
+ ] })
28653
+ ] }, k2)),
28654
+ w.my_lane_seconds_by_third.base > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip", children: [
28655
+ t2(T9.laneBase),
28656
+ " ",
28657
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
28658
+ w.my_lane_seconds_by_third.base,
28659
+ t2(T9.sec)
28660
+ ] })
28661
+ ] }),
28662
+ w.my_lane_seconds_by_third.dead > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip", children: [
28663
+ t2(T9.dead),
28664
+ " ",
28665
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
28666
+ w.my_lane_seconds_by_third.dead,
28667
+ t2(T9.sec)
28668
+ ] })
28669
+ ] }),
28670
+ w.my_lane_seconds_by_third.not_known > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip is-warn", children: [
28671
+ t2(T9.laneNotKnown),
28672
+ " ",
28673
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
28674
+ w.my_lane_seconds_by_third.not_known,
28675
+ t2(T9.sec)
28676
+ ] })
28677
+ ] })
28678
+ ] }),
28679
+ w.roaming_before_10_00 && Array.isArray(w.roaming_trips_before_10_00) && w.roaming_trips_before_10_00.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-line", children: [
28680
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: t2(T9.laneRoamTrips) }),
28681
+ w.roaming_trips_before_10_00.map((tr, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip", children: [
28682
+ tr.from,
28683
+ "\u2013",
28684
+ tr.to,
28685
+ " (",
28686
+ tr.duration_s,
28687
+ t2(T9.sec),
28688
+ ") \xB7 ",
28689
+ T9.lane[tr.lane] ? t2(T9.lane[tr.lane]) : tr.lane,
28690
+ tr.traded_damage_with_enemy_hero === true ? ` \xB7 ${t2(T9.laneRoamTraded)}` : "",
28691
+ typeof tr.enemy_deaths_in_lane === "number" && tr.enemy_deaths_in_lane > 0 ? ` \xB7 ${t2(T9.laneRoamEnemyDied)} ${tr.enemy_deaths_in_lane}` : "",
28692
+ typeof tr.ally_deaths_in_lane === "number" && tr.ally_deaths_in_lane > 0 ? ` \xB7 ${t2(T9.laneRoamAllyDied)} ${tr.ally_deaths_in_lane}` : "",
28693
+ typeof tr.my_death === "string" ? ` \xB7 ${t2(T9.fightDied)} ${tr.my_death}` : ""
28694
+ ] }, i))
28633
28695
  ] })
28634
28696
  ] });
28635
28697
  })(),
@@ -29945,6 +30007,7 @@ function Record({ data: data2, lang }) {
29945
30007
  ] });
29946
30008
  }
29947
30009
  if (data2.kind === "skill_build") {
30010
+ const sbName = (ab) => ab.includes("+") ? ab.split("+").map((k2) => N(k2)).join(" / ") : N(ab);
29948
30011
  const distRow = (label, snap) => snap && snap.abilities && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-line", children: [
29949
30012
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
29950
30013
  label,
@@ -29953,7 +30016,7 @@ function Record({ data: data2, lang }) {
29953
30016
  ")"
29954
30017
  ] }),
29955
30018
  Object.entries(snap.abilities).map(([ab, lv]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip", children: [
29956
- N(ab),
30019
+ sbName(ab),
29957
30020
  " ",
29958
30021
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
29959
30022
  "Lv",
package/lib/index.js CHANGED
@@ -7294,6 +7294,13 @@ function habitGoal(habit, summary, of = null) {
7294
7294
  }
7295
7295
  function evaluateHabit(goal, summary, minutes) {
7296
7296
  const out = (result2, evidence, count) => ({ result: result2, evidence, ...Number.isInteger(count) ? { count } : {} });
7297
+ if (goal?.habit === "low_health" || goal?.habit === "low_health_outside_fights") {
7298
+ return out("unknown", t(
7299
+ "This goal is no longer counted: low HP 12 s before death alone does not capture both sides' kill threat. Pick another goal.",
7300
+ "\u8FD9\u4E2A\u76EE\u6807\u5DF2\u4E0D\u518D\u7EDF\u8BA1\uFF1A\u53EA\u770B\u6B7B\u524D 12 \u79D2\u662F\u5426\u4E0D\u5230\u534A\u8840\u65E0\u6CD5\u53CD\u6620\u53CC\u65B9\u771F\u5B9E\u7684\u51FB\u6740\u5A01\u80C1\u3002\u8BF7\u6362\u4E00\u4E2A\u76EE\u6807\u3002",
7301
+ "\u042D\u0442\u0430 \u0446\u0435\u043B\u044C \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F: \u043D\u0438\u0437\u043A\u043E\u0435 HP \u0437\u0430 12 \u0441 \u0434\u043E \u0441\u043C\u0435\u0440\u0442\u0438 \u0441\u0430\u043C\u043E \u043F\u043E \u0441\u0435\u0431\u0435 \u043D\u0435 \u043E\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0440\u0435\u0430\u043B\u044C\u043D\u0443\u044E \u0443\u0433\u0440\u043E\u0437\u0443 \u0443\u0431\u0438\u0439\u0441\u0442\u0432\u0430 \u043E\u0431\u0435\u0438\u0445 \u0441\u0442\u043E\u0440\u043E\u043D. \u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0443\u044E \u0446\u0435\u043B\u044C."
7302
+ ));
7303
+ }
7297
7304
  if (RETIRED_HABITS.includes(goal?.habit)) return out("unknown", t("This goal is no longer counted: deaths with no ally nearby said little about a decision. Pick another goal.", "\u8FD9\u4E2A\u76EE\u6807\u5DF2\u4E0D\u518D\u7EDF\u8BA1\uFF1A\u8EAB\u8FB9\u6709\u6CA1\u6709\u961F\u53CB\u8BF4\u660E\u4E0D\u4E86\u51B3\u7B56\u5BF9\u9519\u3002\u8BF7\u6362\u4E00\u4E2A\u76EE\u6807\u3002", "\u042D\u0442\u0430 \u0446\u0435\u043B\u044C \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F: \u043D\u0430\u043B\u0438\u0447\u0438\u0435 \u0441\u043E\u044E\u0437\u043D\u0438\u043A\u043E\u0432 \u0440\u044F\u0434\u043E\u043C \u043C\u0430\u043B\u043E \u0433\u043E\u0432\u043E\u0440\u0438\u0442 \u043E \u0440\u0435\u0448\u0435\u043D\u0438\u0438. \u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0443\u044E \u0446\u0435\u043B\u044C."));
7298
7305
  const h = HABITS[goal?.habit];
7299
7306
  if (!h || !Number.isFinite(goal.max) || h.from === "audit" && !(goal.name?.en && goal.name?.zh)) return out("unknown", t("Unknown goal.", "\u65E0\u6CD5\u8BC6\u522B\u7684\u76EE\u6807\u3002", "\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0446\u0435\u043B\u044C."));
@@ -7412,9 +7419,6 @@ var init_goals = __esm({
7412
7419
  GAP = new Set(GAP_CLOSERS);
7413
7420
  clock4 = (sec) => `${Math.floor(Math.max(0, sec) / 60)}:${String(Math.round(Math.max(0, sec)) % 60).padStart(2, "0")}`;
7414
7421
  HABITS = {
7415
- low_health: { from: "deaths", at: ["deaths_where", "health_below_half_at_window_start"], unsure: "health_at_window_start", label: () => t("deaths that began below half health (12 s before)", "\u6B7B\u524D 12 \u79D2\u5DF2\u4E0D\u5230\u534A\u8840\u7684\u9635\u4EA1", "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0441 \u043C\u0435\u043D\u0435\u0435 \u0447\u0435\u043C \u043F\u043E\u043B\u043E\u0432\u0438\u043D\u043E\u0439 HP (\u0437\u0430 12 \u0441 \u0434\u043E \u0441\u043C\u0435\u0440\u0442\u0438)") },
7416
- // Low health, and outnumbered, outside the game's fights only: for a hero whose job is to be in them, that is where the habit shows.
7417
- low_health_outside_fights: { from: "deaths", at: ["deaths_where", "health_below_half_at_window_start_outside_fights"], unsure: "health_below_half_at_window_start_outside_fights", label: () => t("deaths outside fights that began below half health (12 s before)", "\u56E2\u6218\u4E4B\u5916\u3001\u6B7B\u524D 12 \u79D2\u5DF2\u4E0D\u5230\u534A\u8840\u7684\u9635\u4EA1", "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0432\u043D\u0435 \u0434\u0440\u0430\u043A \u0441 \u043C\u0435\u043D\u0435\u0435 \u0447\u0435\u043C \u043F\u043E\u043B\u043E\u0432\u0438\u043D\u043E\u0439 HP (\u0437\u0430 12 \u0441)") },
7418
7422
  outnumbered_outside_fights: { from: "deaths", at: ["deaths_where", "three_or_more_enemy_heroes_dealing_damage_outside_fights"], unsure: "three_or_more_enemy_heroes_dealing_damage_outside_fights", label: () => t("deaths outside fights to three or more enemy heroes", "\u56E2\u6218\u4E4B\u5916\u88AB\u4E09\u4E2A\u4EE5\u4E0A\u654C\u65B9\u82F1\u96C4\u56F4\u6740\u7684\u9635\u4EA1", "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0432\u043D\u0435 \u0434\u0440\u0430\u043A \u043E\u0442 \u0442\u0440\u0451\u0445 \u0438 \u0431\u043E\u043B\u0435\u0435 \u0432\u0440\u0430\u0433\u043E\u0432") },
7419
7423
  outnumbered: { from: "deaths", at: ["deaths_where", "three_or_more_enemy_heroes_dealing_damage"], unsure: null, label: () => t("deaths to three or more enemy heroes", "\u88AB\u4E09\u4E2A\u4EE5\u4E0A\u654C\u65B9\u82F1\u96C4\u56F4\u6740\u7684\u9635\u4EA1", "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u043E\u0442 \u0442\u0440\u0451\u0445 \u0438 \u0431\u043E\u043B\u0435\u0435 \u0432\u0440\u0430\u0433\u043E\u0432") },
7420
7424
  nothing_pressed: { from: "deaths", at: ["deaths_where", "nothing_cast_and_no_item_used"], unsure: null, label: () => t("deaths with nothing cast or used", "\u4EC0\u4E48\u90FD\u6CA1\u6309\u7684\u9635\u4EA1", "\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0431\u0435\u0437 \u0435\u0434\u0438\u043D\u043E\u0439 \u043D\u0430\u0436\u0430\u0442\u043E\u0439 \u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u0438\u043B\u0438 \u043F\u0440\u0435\u0434\u043C\u0435\u0442\u0430") },
@@ -7425,7 +7429,7 @@ var init_goals = __esm({
7425
7429
  died_holding: { from: "audit", at: ["deaths_with_it_ready_and_not_cast_total"], unsure: null, label: (n) => t(`deaths with ${n.en} ready and not cast`, `${n.zh}\u5C31\u7EEA\u5374\u6CA1\u653E\u7684\u9635\u4EA1`, `\u0441\u043C\u0435\u0440\u0442\u0435\u0439 \u0441 \u0433\u043E\u0442\u043E\u0432\u044B\u043C, \u043D\u043E \u043D\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u043D\u044B\u043C ${n.en}`) }
7426
7430
  };
7427
7431
  HABIT_KEYS = Object.keys(HABITS);
7428
- RETIRED_HABITS = Object.freeze(["alone", "alone_not_traded"]);
7432
+ RETIRED_HABITS = Object.freeze(["alone", "alone_not_traded", "low_health", "low_health_outside_fights"]);
7429
7433
  MIN_MINUTES = 10;
7430
7434
  result = (r, evidence) => ({ result: r, evidence });
7431
7435
  }
@@ -12914,7 +12918,7 @@ import { join as join5 } from "node:path";
12914
12918
 
12915
12919
  // lib/agent/review/schema.js
12916
12920
  var DEEP_REVIEW_SCHEMA = "dota2.ai/deep-review@1";
12917
- var DEEP_REVIEW_PROMPT_VERSION = 75;
12921
+ var DEEP_REVIEW_PROMPT_VERSION = 76;
12918
12922
  var MAX_REFS = 3;
12919
12923
  var MAX_FINDINGS = 3;
12920
12924
  var MAX_HIGHLIGHTS = 4;
@@ -18336,7 +18340,7 @@ function meInFightRecord(trace, h, team, key, f, part) {
18336
18340
  };
18337
18341
  const ultKeys = ultimatesOf(key);
18338
18342
  const ultCast = (() => {
18339
- if (!ultKeys.length || hasNoCooldown(key) || ultKeys.every((u) => DEATH_TRIGGERED_ABILITIES.has(u)) || !Array.isArray(trace.casts)) return null;
18343
+ if (!ultKeys.length || ultKeys.every((u) => DEATH_TRIGGERED_ABILITIES.has(u)) || !Array.isArray(trace.casts)) return null;
18340
18344
  const ultIds = new Set(ultKeys.map((u) => nameId(trace, u)).filter((id) => id >= 0));
18341
18345
  let ultWindowUnknown = false;
18342
18346
  if (myNpc >= 0) {
@@ -18377,6 +18381,7 @@ function meInFightRecord(trace, h, team, key, f, part) {
18377
18381
  }
18378
18382
  if (autoMissing) return null;
18379
18383
  }
18384
+ if (hasNoCooldown(key)) return null;
18380
18385
  return ultWindowUnknown ? null : false;
18381
18386
  })();
18382
18387
  const keyItemsUsed = (() => {
@@ -19375,11 +19380,152 @@ function placeAt(trace, i, s) {
19375
19380
  if (st.alive?.[k3] !== 1 || st.x?.[k3] == null || st.y?.[k3] == null) return null;
19376
19381
  return inBase2(st.x[k3], st.y[k3]) ? "base" : third2(st.x[k3], st.y[k3]);
19377
19382
  }
19383
+ function roamingLaneProcess(trace, h) {
19384
+ const byThird = { top: 0, mid: 0, bot: 0, base: 0, dead: 0, not_known: 0 };
19385
+ const rawRuns = [];
19386
+ let curLane = null;
19387
+ let curFrom = -1;
19388
+ let curTo = -1;
19389
+ const flush = () => {
19390
+ if (curLane != null) {
19391
+ rawRuns.push([curFrom, curTo, curLane]);
19392
+ curLane = null;
19393
+ curFrom = -1;
19394
+ curTo = -1;
19395
+ }
19396
+ };
19397
+ for (let s = LANE_FROM; s < LANE_END; s += 1) {
19398
+ const p = placeAt(trace, h, s);
19399
+ if (p === 3) byThird.top += 1;
19400
+ else if (p === 2) byThird.mid += 1;
19401
+ else if (p === 1) byThird.bot += 1;
19402
+ else if (p === "base") byThird.base += 1;
19403
+ else if (p === "dead") byThird.dead += 1;
19404
+ else byThird.not_known += 1;
19405
+ if (typeof p === "number") {
19406
+ if (curLane === p) curTo = s;
19407
+ else {
19408
+ flush();
19409
+ curLane = p;
19410
+ curFrom = s;
19411
+ curTo = s;
19412
+ }
19413
+ } else {
19414
+ flush();
19415
+ }
19416
+ }
19417
+ flush();
19418
+ if (byThird.top + byThird.mid + byThird.bot === 0) {
19419
+ return { unknown: byThird.not_known > 0 ? "positions_not_known" : "no_single_lane" };
19420
+ }
19421
+ const team = trace.heroes[h].team;
19422
+ const all = trace.heroes.map((_, i) => i);
19423
+ const nameIx = (i) => trace.names.indexOf(trace.heroes[i].npc);
19424
+ const heroOfName2 = new Map(all.map((i) => [nameIx(i), i]));
19425
+ const myNpc = nameIx(h);
19426
+ const hasDamage = Array.isArray(trace.damage);
19427
+ const hasDeaths = Array.isArray(trace.deaths);
19428
+ const traceEnd = typeof trace.t0 === "number" && typeof trace.n === "number" ? trace.t0 + trace.n - 1 : null;
19429
+ const allRealDeaths = hasDeaths ? realDeaths(trace).filter((d) => d[0] >= LANE_FROM && d[0] <= LANE_END + VISIT_AFTER) : [];
19430
+ let deathPosMissing = false;
19431
+ let deathWindowTruncated = false;
19432
+ const trips = [];
19433
+ for (const [fromSec, toSec, runLane] of rawRuns) {
19434
+ const endSec = toSec + 1;
19435
+ const duration = endSec - fromSec;
19436
+ if (duration < ROTATION_MIN_SECONDS) continue;
19437
+ let tradedDamage = null;
19438
+ if (hasDamage && myNpc >= 0) {
19439
+ tradedDamage = false;
19440
+ for (const row of trace.damage) {
19441
+ const [sec, att, tgt, , val] = row;
19442
+ if (sec < fromSec || sec >= endSec) continue;
19443
+ if (val != null && !(val > 0)) continue;
19444
+ if (att === myNpc) {
19445
+ const other2 = heroOfName2.get(tgt);
19446
+ if (other2 != null && trace.heroes[other2].team !== team) {
19447
+ tradedDamage = true;
19448
+ break;
19449
+ }
19450
+ } else if (tgt === myNpc) {
19451
+ const other2 = heroOfName2.get(att);
19452
+ if (other2 != null && trace.heroes[other2].team !== team) {
19453
+ tradedDamage = true;
19454
+ break;
19455
+ }
19456
+ }
19457
+ }
19458
+ }
19459
+ let enemyDeathsInLane = null;
19460
+ let allyDeathsInLane = null;
19461
+ let myDeath = null;
19462
+ if (hasDeaths) {
19463
+ if (traceEnd != null && toSec + VISIT_AFTER > traceEnd) {
19464
+ deathWindowTruncated = true;
19465
+ } else {
19466
+ const windowDeaths = allRealDeaths.filter((d) => d[0] >= fromSec && d[0] <= toSec + VISIT_AFTER && heroOfName2.has(d[1]));
19467
+ const where2 = (d) => placeAt(trace, heroOfName2.get(d[1]), Math.floor(d[0]) - 1);
19468
+ const enemyNear = windowDeaths.filter((d) => trace.heroes[heroOfName2.get(d[1])].team !== team);
19469
+ if (enemyNear.some((d) => where2(d) == null)) {
19470
+ deathPosMissing = true;
19471
+ } else {
19472
+ enemyDeathsInLane = enemyNear.filter((d) => where2(d) === runLane).length;
19473
+ }
19474
+ const allyNear = windowDeaths.filter((d) => {
19475
+ const v = heroOfName2.get(d[1]);
19476
+ return v !== h && trace.heroes[v].team === team;
19477
+ });
19478
+ if (allyNear.some((d) => where2(d) == null)) {
19479
+ deathPosMissing = true;
19480
+ } else {
19481
+ allyDeathsInLane = allyNear.filter((d) => where2(d) === runLane).length;
19482
+ }
19483
+ }
19484
+ if (myNpc >= 0) {
19485
+ const nextPlace = placeAt(trace, h, toSec + 1);
19486
+ const myDeathInTrip = allRealDeaths.find((d) => d[1] === myNpc && d[0] >= fromSec && d[0] < endSec);
19487
+ const myDeathAfter = allRealDeaths.find((d) => d[1] === myNpc && d[0] >= endSec && d[0] <= toSec + 2);
19488
+ if (myDeathInTrip) {
19489
+ myDeath = clock3(myDeathInTrip[0]);
19490
+ } else if (myDeathAfter) {
19491
+ if (nextPlace === "dead") myDeath = clock3(myDeathAfter[0]);
19492
+ else if (nextPlace !== null) myDeath = false;
19493
+ } else if (traceEnd == null || toSec + 2 <= traceEnd) {
19494
+ myDeath = false;
19495
+ }
19496
+ }
19497
+ }
19498
+ trips.push({
19499
+ lane: LANE_NAME3[runLane],
19500
+ from: clock3(fromSec),
19501
+ to: clock3(toSec),
19502
+ duration_s: duration,
19503
+ traded_damage_with_enemy_hero: tradedDamage,
19504
+ enemy_deaths_in_lane: enemyDeathsInLane,
19505
+ ally_deaths_in_lane: allyDeathsInLane,
19506
+ my_death: myDeath
19507
+ });
19508
+ }
19509
+ const gaps = [
19510
+ { topic: "single_lane", reason: "no_single_lane_roamer" },
19511
+ ...byThird.not_known > 0 ? [{ topic: "hero_positions", reason: "position_samples_missing_before_10_00", missing_seconds: byThird.not_known }] : [],
19512
+ ...!hasDamage ? [{ topic: "roaming_damage", reason: "no_damage_rows_in_trace" }] : [],
19513
+ ...!hasDeaths ? [{ topic: "roaming_deaths", reason: "no_deaths_in_trace" }] : [],
19514
+ ...deathPosMissing ? [{ topic: "roaming_deaths", reason: "death_position_missing_during_roaming_trip" }] : [],
19515
+ ...deathWindowTruncated ? [{ topic: "roaming_deaths", reason: "trace_ends_before_roaming_death_window" }] : []
19516
+ ];
19517
+ return {
19518
+ roaming_before_10_00: true,
19519
+ my_lane_seconds_by_third: byThird,
19520
+ roaming_trips_before_10_00: trips,
19521
+ gaps
19522
+ };
19523
+ }
19378
19524
  function laneProcess(trace, h) {
19379
19525
  const lanes = trace.heroes.map((_, i) => laneOf(trace, i));
19380
19526
  const lane = lanes[h];
19381
19527
  if (lane === void 0) return { unknown: "positions_not_known" };
19382
- if (lane === null) return { unknown: "no_single_lane" };
19528
+ if (lane === null) return roamingLaneProcess(trace, h);
19383
19529
  const team = trace.heroes[h].team;
19384
19530
  const all = trace.heroes.map((_, i) => i);
19385
19531
  const inLane = all.filter((i) => lanes[i] === lane);
@@ -19644,7 +19790,7 @@ function laneProcess(trace, h) {
19644
19790
  gaps
19645
19791
  };
19646
19792
  }
19647
- var LANE_PROCESS_RULE = `gold_gap_by_source: gold the log says each side of the lane received before 10:00, by source, and lost on dying (the income every hero gets over time is in neither side); visits: a hero from outside the lane exchanging damage with the lane's other side inside the lane's third of the map, seconds ${VISIT_GAP} s or less apart are one visit, died = heroes of the lane or the visitor who died in this lane during it or ${VISIT_AFTER} s after; a hero who came without exchanging damage is not counted; a hero in no single lane who spent ${PART_TIME_SHARE * 100}% or more of the lane stage in this lane shared it (part_time_in_this_lane): not a visitor, and not in the gold sums \u2014 roster_note says when that leaves the sides uneven; a side's visit counts are null (not known) when one of its heroes exchanged damage with the lane at a second the replay has no position for them; my_rotations_before_10_00: trips between 1:00 and 10:00 where the player stayed alive outside base in another lane's third for ${ROTATION_MIN_SECONDS} s or more, with destination, power_runes_activated (power-rune buff modifier activations from trace.runes \u2014 not rune pickups, bottled runes, bounty, water or wisdom runes), wards placed (null if a same-team ward during the trip has an unknown placer), enemy deaths in [from, to + 10 s] that the player damaged during [from, to + 1 s) within 15 s before the death, whether the player died on the trip, and any fixed lane partner deaths while away (null when positions or source logs are missing)`;
19793
+ var LANE_PROCESS_RULE = `gold_gap_by_source: gold the log says each side of the lane received before 10:00, by source, and lost on dying (the income every hero gets over time is in neither side); visits: a hero from outside the lane exchanging damage with the lane's other side inside the lane's third of the map, seconds ${VISIT_GAP} s or less apart are one visit, died = heroes of the lane or the visitor who died in this lane during it or ${VISIT_AFTER} s after; a hero who came without exchanging damage is not counted; a hero in no single lane who spent ${PART_TIME_SHARE * 100}% or more of the lane stage in this lane shared it (part_time_in_this_lane): not a visitor, and not in the gold sums \u2014 roster_note says when that leaves the sides uneven; a side's visit counts are null (not known) when one of its heroes exchanged damage with the lane at a second the replay has no position for them; my_rotations_before_10_00: trips between 1:00 and 10:00 where the player stayed alive outside base in another lane's third for ${ROTATION_MIN_SECONDS} s or more, with destination, power_runes_activated (power-rune buff modifier activations from trace.runes \u2014 not rune pickups, bottled runes, bounty, water or wisdom runes), wards placed (null if a same-team ward during the trip has an unknown placer), enemy deaths in [from, to + 10 s] that the player damaged during [from, to + 1 s) within 15 s before the death, whether the player died on the trip, and any fixed lane partner deaths while away (null when positions or source logs are missing); roaming_before_10_00: when the player spent under 60% of 1:00\u201310:00 in any single lane, my_lane_seconds_by_third counts seconds per lane third (top/mid/bot/base/dead/not_known) and roaming_trips_before_10_00 lists contiguous stays of ${ROTATION_MIN_SECONDS} s or more in one lane third (broken by missing positions, base, or death) with whether the player traded hero damage during [from, to + 1 s), enemy and ally deaths in that lane within [from, to + ${VISIT_AFTER} s] (null when any death's pre-death position or the log is missing), and my_death`;
19648
19794
  var LANE_PROCESS_REFERENCE = "On 209 parsed games: in the 444 lane sides that lost their lane in the 194 games whose gold log has dying rows, the gold behind from hero kills, assists and dying (netted together) added up to about as much as the gold behind from lane creeps (255k against 286k), and was the larger part in 44% of them (197). How many times enemies visited a lane did not go with losing it (lost 39% with no visit, 37% with three or more); visits that cost the lane side more deaths in the lane than the enemy did (one or more net) did: lost 48% (141 of 295), against 36% (333 of 930) otherwise. 168 of the 1225 lane sides had a hero sharing the lane part-time (their sums leave that hero out); without them the same holds (45% of 392; 46% against 35%). On 59 games (562 single-lane heroes, 302 early rotation trips of 20 s+ before 10:00): 56% (170/302) included an enemy death the player damaged, 20% (59/302) placed a ward, 8% (24/302) activated a power rune, and in 7% (22/302) a fixed lane partner died while the player was away. A reference for how much each part usually weighs, not what happened here.";
19649
19795
 
19650
19796
  // lib/agent/draftReport.js
@@ -20323,7 +20469,22 @@ function levelAt(trace, seatIndex, t6) {
20323
20469
  }
20324
20470
  return null;
20325
20471
  }
20326
- function snapshotAtHeroLevel(trace, seatIndex, targetLevel, heroAbilitiesList, initialOnlyKeys) {
20472
+ function upgradeSequence(levels) {
20473
+ const sorted = [...levels].sort((a, b) => a[0] - b[0]);
20474
+ const seq = [];
20475
+ let highest = 0;
20476
+ for (const [at, lv] of sorted) {
20477
+ if (!(lv > highest)) continue;
20478
+ seq.push([at, lv]);
20479
+ highest = lv;
20480
+ }
20481
+ return seq;
20482
+ }
20483
+ function sameUpgradeSequence(a, b) {
20484
+ if (!a.length || a.length !== b.length) return false;
20485
+ return a.every(([tA, lvA], i) => lvA === b[i][1] && Math.abs(tA - b[i][0]) <= 1);
20486
+ }
20487
+ function snapshotAtHeroLevel(trace, seatIndex, targetLevel, heroAbilitiesList, initialOnlyKeys, linkedGroupKeyByMember) {
20327
20488
  const levels = trace.states?.[seatIndex]?.level;
20328
20489
  if (!Array.isArray(levels) || !levels.some((v) => Number.isFinite(v))) return null;
20329
20490
  const i = levels.findIndex((v) => Number.isFinite(v) && v >= targetLevel);
@@ -20347,7 +20508,10 @@ function snapshotAtHeroLevel(trace, seatIndex, targetLevel, heroAbilitiesList, i
20347
20508
  for (const [k3, entry] of heroAbilitiesList) {
20348
20509
  if (initialOnlyKeys.has(k3)) continue;
20349
20510
  const lv = abilityLevel(entry, evalT);
20350
- if (lv > 0) abilities[k3] = lv;
20511
+ if (lv > 0) {
20512
+ const outKey = linkedGroupKeyByMember.get(k3) ?? k3;
20513
+ abilities[outKey] = Math.max(abilities[outKey] ?? 0, lv);
20514
+ }
20351
20515
  }
20352
20516
  return { clock: clock3(reachedT), abilities };
20353
20517
  }
@@ -20405,6 +20569,24 @@ function skillBuild(trace, args = {}, ctx = {}) {
20405
20569
  ]
20406
20570
  };
20407
20571
  }
20572
+ const primaryUltKey = pd.ultimate(hero.id)?.key ?? ultimatesOf(slug2)[0] ?? null;
20573
+ const ultEntries = heroAbilitiesList.filter(([k3]) => ultKeys.has(k3)).map(([k3, entry]) => ({ key: k3, seq: upgradeSequence(entry.levels) })).sort((a, b) => a.key === primaryUltKey ? -1 : b.key === primaryUltKey ? 1 : a.key.localeCompare(b.key));
20574
+ const ultGroups = [];
20575
+ for (const item of ultEntries) {
20576
+ const match = ultGroups.find((g) => sameUpgradeSequence(g.seq, item.seq));
20577
+ if (match) match.keys.push(item.key);
20578
+ else ultGroups.push({ seq: item.seq, keys: [item.key] });
20579
+ }
20580
+ const linkedUltimates = ultGroups.filter((g) => g.keys.length > 1).map((g) => g.keys);
20581
+ const linkedWithMap = /* @__PURE__ */ new Map();
20582
+ const linkedGroupKeyByMember = /* @__PURE__ */ new Map();
20583
+ for (const group of linkedUltimates) {
20584
+ const combinedKey = group.join("+");
20585
+ for (const k3 of group) {
20586
+ linkedWithMap.set(k3, group.filter((other2) => other2 !== k3));
20587
+ linkedGroupKeyByMember.set(k3, combinedKey);
20588
+ }
20589
+ }
20408
20590
  const upgradeTimeline = [];
20409
20591
  const innateMetaExact = Boolean(pd.exact && pd.major === ABILITIES6.patch);
20410
20592
  const nonPointKeys = /* @__PURE__ */ new Set();
@@ -20416,6 +20598,7 @@ function skillBuild(trace, args = {}, ctx = {}) {
20416
20598
  const firstLearned = sorted.find(([, lv]) => lv > 0);
20417
20599
  const maxLv = sorted.reduce((m, [, lv]) => lv > m ? lv : m, 0);
20418
20600
  const isUlt = ultKeys.has(k3);
20601
+ const linkedWith = linkedWithMap.get(k3);
20419
20602
  const isLearnable = pdMap.has(k3) || isUlt;
20420
20603
  const isMetadataNonPoint = !isLearnable && innateMetaExact && Boolean(ALL_ABILITIES2[k3]);
20421
20604
  const isKnownInnate = isMetadataNonPoint && Boolean(firstLearned && firstLearned[0] <= trace.t0 + 2 && firstLearned[1] === 1);
@@ -20437,6 +20620,7 @@ function skillBuild(trace, args = {}, ctx = {}) {
20437
20620
  name: abilityDisplayName(k3),
20438
20621
  ability_level: lv,
20439
20622
  ...isUlt ? { ultimate: true } : {},
20623
+ ...linkedWith ? { linked_with: linkedWith } : {},
20440
20624
  ...isInitialInnate ? { initial: true, innate: true } : {}
20441
20625
  });
20442
20626
  if (cap != null && !maxedRecorded && lv >= cap) {
@@ -20459,10 +20643,17 @@ function skillBuild(trace, args = {}, ctx = {}) {
20459
20643
  const levelsMissing = !Array.isArray(levelsArr) || !levelsArr.some((v) => Number.isFinite(v));
20460
20644
  const hasIncompleteLevels = missingLevelAbilities.length > 0;
20461
20645
  const ultLevelsIncomplete = missingLevelAbilities.some((k3) => ultKeys.has(k3));
20462
- const atLevel6 = hasIncompleteLevels ? null : snapshotAtHeroLevel(trace, seatIndex, 6, heroAbilitiesList, nonPointKeys);
20463
- const atLevel10 = hasIncompleteLevels ? null : snapshotAtHeroLevel(trace, seatIndex, 10, heroAbilitiesList, nonPointKeys);
20646
+ const atLevel6 = hasIncompleteLevels ? null : snapshotAtHeroLevel(trace, seatIndex, 6, heroAbilitiesList, nonPointKeys, linkedGroupKeyByMember);
20647
+ const atLevel10 = hasIncompleteLevels ? null : snapshotAtHeroLevel(trace, seatIndex, 10, heroAbilitiesList, nonPointKeys, linkedGroupKeyByMember);
20464
20648
  const maxedOrder = hasIncompleteLevels ? null : maxedEntries.map(({ t: _t, ...rest }) => rest);
20465
- const ultimateLevels = ultLevelsIncomplete ? null : upgradeTimeline.filter((u) => u.ultimate === true).map((u) => ({ ability: u.ability, name: u.name, level: u.ability_level, clock: u.clock, hero_level: u.hero_level }));
20649
+ const ultimateLevels = ultLevelsIncomplete ? null : upgradeTimeline.filter((u) => u.ultimate === true).map((u) => ({
20650
+ ability: u.ability,
20651
+ name: u.name,
20652
+ level: u.ability_level,
20653
+ clock: u.clock,
20654
+ hero_level: u.hero_level,
20655
+ ...u.linked_with ? { linked_with: u.linked_with } : {}
20656
+ }));
20466
20657
  return {
20467
20658
  ref: `skill_build:${slug2}`,
20468
20659
  hero: slug2,
@@ -20472,8 +20663,9 @@ function skillBuild(trace, args = {}, ctx = {}) {
20472
20663
  at_level_10: atLevel10,
20473
20664
  maxed_order: maxedOrder,
20474
20665
  ultimate_levels: ultimateLevels,
20666
+ ...linkedUltimates.length ? { linked_ultimates: linkedUltimates } : {},
20475
20667
  talents,
20476
- note: "Upgrade times come from replay ability-level samples. Innate and Scepter/Shard-granted abilities established by Valve patch metadata are excluded from at_level_6 / at_level_10 skill-point distributions (innates are marked innate: true, initial: true); normal learnable skills kept at level 1 stay included. maxed_order records when each non-ultimate ability reaches its ability cap.",
20668
+ note: 'Upgrade times come from replay ability-level samples. Innate and Scepter/Shard-granted abilities established by Valve patch metadata are excluded from at_level_6 / at_level_10 skill-point distributions (innates are marked innate: true, initial: true); normal learnable skills kept at level 1 stay included. Linked ultimates that level together on one skill point (e.g. Dark Willow Bedlam + Terrorize) stay listed in upgrade_timeline and ultimate_levels with linked_with, and are combined under a "+" key in at_level_6 / at_level_10 so each shared skill point is counted once. maxed_order records when each non-ultimate ability reaches its ability cap.',
20477
20669
  gaps: [
20478
20670
  ...hasIncompleteLevels ? [{ topic: "skill_build", reason: "incomplete_ability_level_samples", abilities: missingLevelAbilities }] : [],
20479
20671
  ...levelsMissing ? [{ topic: "hero_levels", reason: "level_samples_missing_in_trace" }] : [],
@@ -20632,6 +20824,7 @@ function laneReport(trace, args = {}, ctx = {}) {
20632
20824
  return k3 ? k3.key : null;
20633
20825
  };
20634
20826
  const proc = laneProcess(trace, seatIndex);
20827
+ const howTheLaneWent = proc.unknown ? null : proc.roaming_before_10_00 ? { ...proc, rule: LANE_PROCESS_RULE } : (({ lane: lane2, heroes_in_lane, ...rest }) => ({ lane_read_from_replay: lane2, heroes_in_lane_read_from_replay: heroes_in_lane, ...rest, rule: LANE_PROCESS_RULE, reference: LANE_PROCESS_REFERENCE }))(proc);
20635
20828
  const base = {
20636
20829
  ref: `lane:${slug2}`,
20637
20830
  hero: slug2,
@@ -20639,10 +20832,10 @@ function laneReport(trace, args = {}, ctx = {}) {
20639
20832
  my_deaths_before_10_00: early.map((d) => ({ clock: clock3(d[0]), killer: killer(d[2]) })),
20640
20833
  // Its own lane and roster, read from the replay's positions: the match record's lane above may group the heroes
20641
20834
  // differently (a hero it marks as roaming), and these sums are over this roster, not that one.
20642
- how_the_lane_went: proc.unknown ? null : (({ lane: lane2, heroes_in_lane, ...rest }) => ({ lane_read_from_replay: lane2, heroes_in_lane_read_from_replay: heroes_in_lane, ...rest, rule: LANE_PROCESS_RULE, reference: LANE_PROCESS_REFERENCE }))(proc),
20835
+ how_the_lane_went: howTheLaneWent,
20643
20836
  ...proc.unknown ? { how_the_lane_went_not_known: proc.unknown } : {},
20644
20837
  // The visit counts again, one level down: the tool's own counts a sentence may quote (null: not known).
20645
- ...proc.unknown ? {} : { lane_visit_counts: {
20838
+ ...proc.unknown || proc.roaming_before_10_00 ? {} : { lane_visit_counts: {
20646
20839
  enemy_visits: proc.enemy_visits?.visits ?? null,
20647
20840
  my_team_deaths_in_enemy_visits: proc.enemy_visits?.my_team_deaths_in_them ?? null,
20648
20841
  enemy_deaths_in_enemy_visits: proc.enemy_visits?.enemy_deaths_in_them ?? null,
@@ -20815,7 +21008,7 @@ var KNOWLEDGE_TOOLS = [
20815
21008
  },
20816
21009
  {
20817
21010
  name: "lane_report",
20818
- description: "The laning stage of a hero (use it for the player): who was in the lane, and per hero the last hits at 5:00 and 10:00, denies, gold and XP at 10:00, the lane's result and the rule it is called by, when each side's first tower fell, the player's deaths before 10:00, and how the lane went (how_the_lane_went, from the replay, with the lane and the heroes it was read over \u2014 the record may group them differently): the lane's gold gap before 10:00 split by source \u2014 last hits, kills and assists, gold lost on dying \u2014 and running every two minutes, the visits of heroes from outside the lane who exchanged damage in it and who died then, where the player spent the lane stage, and the player's early rotation trips away from their main lane (`my_rotations_before_10_00`: trips of 20 s+ with destination, power runes activated, wards placed, enemy deaths damaged, and lane partner deaths while away) \u2014 next to how the same core matchup usually stands at 10:00 in professional games and how the lane goes in public games of the player's bracket. Look here before saying anything about the lane. When the match data has no per-minute numbers it reads the lane, last hits, denies and the lane's result from the replay instead (read_from: replay; no XP, no pro or public baseline), and says what it could not read under gaps.",
21011
+ description: "The laning stage of a hero (use it for the player): who was in the lane, and per hero the last hits at 5:00 and 10:00, denies, gold and XP at 10:00, the lane's result and the rule it is called by, when each side's first tower fell, the player's deaths before 10:00, and how the lane went (how_the_lane_went, from the replay, with the lane and the heroes it was read over \u2014 the record may group them differently): the lane's gold gap before 10:00 split by source \u2014 last hits, kills and assists, gold lost on dying \u2014 and running every two minutes, the visits of heroes from outside the lane who exchanged damage in it and who died then, where the player spent the lane stage, and the player's early rotation trips away from their main lane (`my_rotations_before_10_00`: trips of 20 s+ with destination, power runes activated, wards placed, enemy deaths damaged, and lane partner deaths while away) \u2014 or, for a roaming hero in no single lane before 10:00, `roaming_before_10_00: true`, `my_lane_seconds_by_third` (seconds in top/mid/bot/base/dead/not_known), and `roaming_trips_before_10_00` (contiguous 20 s+ lane stays with enemy damage exchange, lane deaths, and own death, while `lane` stays null) \u2014 next to how the same core matchup usually stands at 10:00 in professional games and how the lane goes in public games of the player's bracket. Look here before saying anything about the lane. When the match data has no per-minute numbers it reads the lane, last hits, denies and the lane's result from the replay instead (read_from: replay; no XP, no pro or public baseline), and says what it could not read under gaps.",
20819
21012
  input_schema: { type: "object", properties: { hero: HERO4 }, required: ["hero"], additionalProperties: false },
20820
21013
  run: laneReport
20821
21014
  },
@@ -20947,6 +21140,7 @@ function namesIn(value, lang) {
20947
21140
  } else if (Array.isArray(v)) v.forEach(walk);
20948
21141
  else if (v && typeof v === "object") for (const [k3, x] of Object.entries(v)) {
20949
21142
  if (/^[a-z][a-z0-9_]{1,60}$/.test(k3) && typeof x === "number") see(k3);
21143
+ else if (typeof x === "number" && /^[a-z][a-z0-9_]{1,60}(\+[a-z][a-z0-9_]{1,60})+$/.test(k3)) k3.split("+").forEach(see);
20950
21144
  else if (typeof x === "number" && /^[a-z][a-z0-9_]{1,60}: /.test(k3)) see(k3.slice(0, k3.indexOf(":")));
20951
21145
  walk(x);
20952
21146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qianhaoq/dsh-dota2ai",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
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",