MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / getStatus

Function getStatus

packages/node-sdk/src/rpc.ts:443–486  ·  view source on GitHub ↗
(input: SessionIdRpcInput)

Source from the content-addressed store, hash-verified

441 }
442
443 async getStatus(input: SessionIdRpcInput): Promise<SessionStatus> {
444 const rpc = await this.getRpc();
445 const agentId = this.interactiveAgentId;
446 const config = await rpc.getConfig({
447 sessionId: input.sessionId,
448 agentId,
449 });
450 const context = await rpc.getContext({
451 sessionId: input.sessionId,
452 agentId,
453 });
454 const permission = await rpc.getPermission({
455 sessionId: input.sessionId,
456 agentId,
457 });
458 const plan = await rpc.getPlan({
459 sessionId: input.sessionId,
460 agentId,
461 });
462 const swarmMode = await rpc.getSwarmMode({
463 sessionId: input.sessionId,
464 agentId,
465 });
466 const usage = await rpc.getUsage({
467 sessionId: input.sessionId,
468 agentId,
469 });
470 const maxContextTokens = config.modelCapabilities?.max_context_tokens ?? 0;
471 const contextTokens = context.tokenCount;
472 const contextUsage = maxContextTokens > 0 ? contextTokens / maxContextTokens : 0;
473 const hasUsage =
474 usage.byModel !== undefined || usage.total !== undefined || usage.currentTurn !== undefined;
475 return {
476 model: config.modelAlias ?? config.provider?.model,
477 thinkingEffort: config.thinkingEffort,
478 permission: permission.mode,
479 planMode: plan !== null,
480 swarmMode,
481 contextTokens,
482 maxContextTokens,
483 contextUsage,
484 usage: hasUsage ? usage : undefined,
485 };
486 }
487
488 async listSkills(input: SessionIdRpcInput): Promise<readonly SkillSummary[]> {
489 const rpc = await this.getRpc();

Callers

nothing calls this directly

Calls 7

getConfigMethod · 0.65
getRpcMethod · 0.45
getContextMethod · 0.45
getPermissionMethod · 0.45
getPlanMethod · 0.45
getSwarmModeMethod · 0.45
getUsageMethod · 0.45

Tested by

no test coverage detected