MCPcopy Create free account
hub / github.com/agent-tower/core / withProjectGitCapability

Function withProjectGitCapability

packages/server/src/services/task.service.ts:224–235  ·  view source on GitHub ↗
(
  task: T,
  capability: Awaited<ReturnType<typeof detectProjectGitCapability>>
)

Source from the content-addressed store, hash-verified

222 consumedEnd: number;
223 body: string;
224} {
225 const linePattern = /[^\r\n]+/g;
226 let lineMatch: RegExpExecArray | null;
227
228 while ((lineMatch = linePattern.exec(rawBody)) !== null) {
229 const compactedLine = compactWhitespaceWithSourceOffsets(lineMatch[0]);
230 if (compactedLine.value.length === 0) {
231 continue;
232 }
233
234 const sentenceMatch = compactedLine.value.match(/^(.+?[。!?.!?])(?:\s|$)/u);
235 const candidate = sentenceMatch?.[1] ?? compactedLine.value;
236 const normalizedTitle = truncateWithEllipsisDetails(candidate, TASK_TITLE_MAX_LENGTH);
237 const consumedLineEnd = compactedLine.sourceEndOffsets[normalizedTitle.consumedLength - 1] ?? 0;
238 const rawConsumedEnd = lineMatch.index + consumedLineEnd;

Callers 2

withProjectGitMetadataFunction · 0.85
findByProjectIdMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected