@chatpanel/events 0.79.0 → 0.79.1

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.
@@ -48,9 +48,12 @@ export function appoint(role, candidates, { overrides = {}, exclude = null } = {
48
48
  if (m) return withTierAndMode(m);
49
49
  }
50
50
  const want = TIER_RANK[role.prefer] ?? 1;
51
+ // Ties go to ROSTER ORDER, not to the alphabet: the host lists what it trusts first (the
52
+ // model the person is already chatting with, installed agents), and over a gateway that
53
+ // lists eight hundred models the alphabet picks a provider nobody has used.
51
54
  const best = usable
52
- .map((c) => ({ c: withTierAndMode(c), d: Math.abs((TIER_RANK[classifyModel(c.model)] ?? 1) - want) }))
53
- .sort((a, b) => a.d - b.d || (a.c.name || a.c.id).localeCompare(b.c.name || b.c.id))[0];
55
+ .map((c, i) => ({ c: withTierAndMode(c), d: Math.abs((TIER_RANK[classifyModel(c.model)] ?? 1) - want), i }))
56
+ .sort((a, b) => a.d - b.d || a.i - b.i)[0];
54
57
  return best.c;
55
58
  }
56
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/events",
3
- "version": "0.79.0",
3
+ "version": "0.79.1",
4
4
  "description": "The canonical ChatPanel event-log and capability contracts \u2014 typed durable facts, clock-free deterministic linearization, schema upcasting, and the invariants the replay harness asserts. Pure, dependency-free ESM shared by the ChatPanel extension, gateway and bridge.",
5
5
  "type": "module",
6
6
  "main": "index.js",