MCPcopy
hub / github.com/claude-code-best/claude-code / buildStatusLineCommandInput

Function buildStatusLineCommandInput

src/components/StatusLine.tsx:216–315  ·  view source on GitHub ↗
(
  permissionMode: PermissionMode,
  exceeds200kTokens: boolean,
  settings: ReadonlySettings,
  messages: Message[],
  addedDirs: string[],
  mainLoopModel: ModelName,
  vimMode?: VimMode,
)

Source from the content-addressed store, hash-verified

214}
215
216function buildStatusLineCommandInput(
217 permissionMode: PermissionMode,
218 exceeds200kTokens: boolean,
219 settings: ReadonlySettings,
220 messages: Message[],
221 addedDirs: string[],
222 mainLoopModel: ModelName,
223 vimMode?: VimMode,
224): StatusLineCommandInput {
225 const agentType = getMainThreadAgentType();
226 const worktreeSession = getCurrentWorktreeSession();
227 const runtimeModel = getRuntimeMainLoopModel({
228 permissionMode,
229 mainLoopModel,
230 exceeds200kTokens,
231 });
232 const outputStyleName = settings?.outputStyle || DEFAULT_OUTPUT_STYLE_NAME;
233
234 const currentUsage = getCurrentUsage(messages);
235 const contextWindowSize = getContextWindowForModel(runtimeModel, getSdkBetas());
236 const contextPercentages = calculateContextPercentages(currentUsage, contextWindowSize);
237
238 const sessionId = getSessionId();
239 const sessionName = getCurrentSessionTitle(sessionId);
240 const rawUtil = getRawUtilization();
241 const rateLimits: NonNullable<StatusLineCommandInput['rate_limits']> = {
242 ...(rawUtil.five_hour && {
243 five_hour: {
244 used_percentage: rawUtil.five_hour.utilization * 100,
245 resets_at: rawUtil.five_hour.resets_at,
246 },
247 }),
248 ...(rawUtil.seven_day && {
249 seven_day: {
250 used_percentage: rawUtil.seven_day.utilization * 100,
251 resets_at: rawUtil.seven_day.resets_at,
252 },
253 }),
254 };
255 return {
256 ...createBaseHookInput(),
257 ...(sessionName && { session_name: sessionName }),
258 model: {
259 id: runtimeModel,
260 display_name: renderModelName(runtimeModel),
261 },
262 workspace: {
263 current_dir: getCwd(),
264 project_dir: getOriginalCwd(),
265 added_dirs: addedDirs,
266 },
267 version: MACRO.VERSION,
268 output_style: {
269 name: outputStyleName,
270 },
271 cost: {
272 total_cost_usd: getTotalCost(),
273 total_duration_ms: getTotalDuration(),

Callers 1

StatusLineInnerFunction · 0.85

Calls 15

getMainThreadAgentTypeFunction · 0.85
getRuntimeMainLoopModelFunction · 0.85
getCurrentUsageFunction · 0.85
getContextWindowForModelFunction · 0.85
getSdkBetasFunction · 0.85
getSessionIdFunction · 0.85
getCurrentSessionTitleFunction · 0.85
getRawUtilizationFunction · 0.85
createBaseHookInputFunction · 0.85
renderModelNameFunction · 0.85

Tested by

no test coverage detected