MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / autoTitleFromPrompt

Function autoTitleFromPrompt

packages/core/src/agent.ts:380–384  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

378}
379
380function autoTitleFromPrompt(prompt: string): string {
381 const condensed = prompt.replace(/\s+/g, ' ').trim();
382 if (condensed.length === 0) return 'Untitled design';
383 return condensed.length > 40 ? `${condensed.slice(0, 40).trimEnd()}…` : condensed;
384}
385
386function emitPreflightSetTitle(onEvent: GenerateViaAgentDeps['onEvent'], title: string): void {
387 if (!onEvent) return;

Callers 1

generateViaAgentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected