MCPcopy Create free account
hub / github.com/arctic-cli/interface / fallbackTitleFromMessage

Function fallbackTitleFromMessage

packages/arctic/src/session/prompt.ts:1685–1699  ·  view source on GitHub ↗
(message: MessageV2.WithParts)

Source from the content-addressed store, hash-verified

1683 }
1684
1685 function fallbackTitleFromMessage(message: MessageV2.WithParts) {
1686 for (const part of message.parts) {
1687 if (part.type === "text" && !part.synthetic && part.text.trim().length > 0) {
1688 const cleaned = part.text.replace(/\s+/g, " ").trim()
1689 return cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned
1690 }
1691 }
1692 for (const part of message.parts) {
1693 if (part.type === "file" && part.filename) {
1694 const cleaned = `File: ${part.filename}`
1695 return cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned
1696 }
1697 }
1698 return undefined
1699 }
1700
1701 async function ensureTitle(input: {
1702 session: Session.Info

Callers 1

ensureTitleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected