chore(client): drop dead UI code
Nothing imports SessionCard, CardSkeleton, shortModel or agentPillLabel — the Sessions page renders its own list, formatModelName replaced shortModel, and the UI labels agents through agentOriginLabel. Removes the symbols, their Public surface entries, and the ARCHITECTURE mention of SessionCard.
This commit is contained in:
@@ -59,7 +59,6 @@
|
||||
* - `buildEventTitle` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `shortAgentLabel` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `AgentInfo` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `agentPillLabel` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `agentOriginLabel` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `buildOriginLabel` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `projectFromCwd` — exported API; see TSDoc on the symbol for behavior.
|
||||
@@ -97,11 +96,6 @@
|
||||
* the signature and return type as stable unless release notes say otherwise.
|
||||
* When behavior changes, update the `@file` overview and relevant tests.
|
||||
*
|
||||
* **agentPillLabel**
|
||||
* Part of this module's public contract. Downstream imports should treat
|
||||
* the signature and return type as stable unless release notes say otherwise.
|
||||
* When behavior changes, update the `@file` overview and relevant tests.
|
||||
*
|
||||
* **agentOriginLabel**
|
||||
* Part of this module's public contract. Downstream imports should treat
|
||||
* the signature and return type as stable unless release notes say otherwise.
|
||||
@@ -689,29 +683,8 @@ function singleAgentSegment(info: AgentInfo): string | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Resolves the pill label for an event's agent. Returns null when the event
|
||||
* comes from the session's main agent (the pill is noise in that case) or
|
||||
* when no info is available. Prefers subagent_type (e.g. "frontend-reviewer"),
|
||||
* then the agent's name, and finally the last-8 short ID fallback.
|
||||
* @param agentId The event's `agent_id`; null yields null.
|
||||
* @param info Optional {@link AgentInfo} for that agent, when known.
|
||||
* @returns The pill text, or null when nothing worth showing exists.
|
||||
*/
|
||||
export function agentPillLabel(agentId: string | null, info: AgentInfo | undefined): string | null {
|
||||
if (!agentId) return null;
|
||||
if (info) {
|
||||
const seg = singleAgentSegment(info);
|
||||
// A concrete subagent label wins outright.
|
||||
if (seg !== null) return seg;
|
||||
// Known main agent with no segment → deliberately no pill.
|
||||
if (info.type === "main") return null;
|
||||
}
|
||||
// No usable info: fall back to the id-derived short label.
|
||||
return shortAgentLabel(agentId);
|
||||
}
|
||||
|
||||
/** Resolves a label that always identifies an event's agent origin - unlike
|
||||
* agentPillLabel, this returns "main" for main agents instead of null. Used
|
||||
/** Resolves a label that always identifies an event's agent origin - it returns
|
||||
* "main" for main agents rather than hiding them. Used
|
||||
* by the inline origin prefix ("{session} › {agent} · {action}").
|
||||
*
|
||||
* When an `agentInfoById` map is provided AND the event's agent has a
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
* - `fmt` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `fmtCost` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `fmtCostFull` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `shortModel` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `formatModelName` — exported API; see TSDoc on the symbol for behavior.
|
||||
* - `pathBasename` — exported API; see TSDoc on the symbol for behavior.
|
||||
*
|
||||
@@ -133,11 +132,6 @@
|
||||
* the signature and return type as stable unless release notes say otherwise.
|
||||
* When behavior changes, update the `@file` overview and relevant tests.
|
||||
*
|
||||
* **shortModel**
|
||||
* Part of this module's public contract. Downstream imports should treat
|
||||
* the signature and return type as stable unless release notes say otherwise.
|
||||
* When behavior changes, update the `@file` overview and relevant tests.
|
||||
*
|
||||
* **formatModelName**
|
||||
* Part of this module's public contract. Downstream imports should treat
|
||||
* the signature and return type as stable unless release notes say otherwise.
|
||||
@@ -431,23 +425,6 @@ export function fmtCostFull(n: number, decimals = 2): string {
|
||||
// Model-name + path formatters
|
||||
// ===========================================================================
|
||||
|
||||
/**
|
||||
* Strip the date suffix from a Claude model ID:
|
||||
* "claude-opus-4-7-20260101" → "opus-4-7". Returns the original string
|
||||
* when the pattern doesn't match, and null/undefined unchanged.
|
||||
* @param model A raw model identifier, or null/undefined.
|
||||
* @returns The captured `tier-major(-minor)` slug (e.g. `"opus-4-7"`), the original
|
||||
* string if it isn't a `claude-…` id, or `null` for falsy input.
|
||||
* @remarks The capture group `([a-z]+-\d+(?:-\d+)?)` grabs the family plus a one- or
|
||||
* two-segment version (`sonnet-4`, `opus-4-7`) but stops before the trailing
|
||||
* `-YYYYMMDD` date. This is the terse form; {@link formatModelName} is the pretty one.
|
||||
*/
|
||||
export function shortModel(model: string | null | undefined): string | null {
|
||||
if (!model) return null;
|
||||
const m = model.match(/claude-([a-z]+-\d+(?:-\d+)?)/i);
|
||||
return m?.[1] ?? model; // captured slug, else the input unchanged
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup from a lowercased leading token to its display brand. Drives the
|
||||
* brand-specific formatting branches in {@link formatModelName}; a token absent
|
||||
|
||||
Reference in New Issue
Block a user