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

Function extractTaskFromMessages

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

Source from the content-addressed store, hash-verified

488}
489
490function extractTaskFromMessages(messages: string[]): string {
491 // First user message is usually the task
492 const first = messages[0] || "";
493
494 // If it starts with "Implement", "Build", "Fix", etc., use first line
495 const firstLine = first.split("\n")[0].trim();
496 if (firstLine.length > 10 && firstLine.length < 300) {
497 return firstLine;
498 }
499
500 // Try to find a task-like sentence
501 for (const msg of messages) {
502 const match = msg.match(
503 /(?:implement|build|fix|create|add|refactor|debug|optimize|update|migrate)\s+(.+?)(?:\.|$)/i
504 );
505 if (match) return match[0].trim().slice(0, 200);
506 }
507
508 return first.slice(0, 200);
509}
510
511function extractDecisions(messages: string[]): string[] {
512 const decisions: string[] = [];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected