MCPcopy Create free account
hub / github.com/IAmUnbounded/devctx / extractState

Function extractState

devctx/src/core/parser.ts:558–571  ·  view source on GitHub ↗
(messages: string[])

Source from the content-addressed store, hash-verified

556}
557
558function extractState(messages: string[]): string {
559 // Look at last assistant message for state
560 const last = messages[messages.length - 1] || "";
561
562 // Look for state indicators
563 const stateMatch = last.match(
564 /(?:currently|now|at this point|so far|status:?)\s*(.+?)(?:\.|$)/i
565 );
566 if (stateMatch) return stateMatch[0].trim().slice(0, 300);
567
568 // Use last meaningful line
569 const lines = last.split("\n").filter((l) => l.trim().length > 20);
570 return lines[lines.length - 1]?.trim()?.slice(0, 300) || "";
571}
572
573function extractNextSteps(messages: string[]): string[] {
574 const steps: string[] = [];

Callers 1

parseClaudeSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected