MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / placeEvent

Function placeEvent

graph-ui/src/agents/agent-placement.ts:193–292  ·  view source on GitHub ↗
(
    event: AgentEvent,
    kind: WorkKind,
    index: PlacementIndex,
)

Source from the content-addressed store, hash-verified

191
192/** Wo dieses Ereignis liegt. */
193export function placeEvent(
194 event: AgentEvent,
195 kind: WorkKind,
196 index: PlacementIndex,
197): Placement {
198 const empty = { ghostIds: [] as number[] };
199 const path = normalizePath(event.path);
200
201 if (kind === 'test') {
202 const tested = testedPathOf(event.detail, index);
203 if (tested.length > 0) {
204 const node = fileNodeOf(index.byPath.get(tested) ?? []);
205 if (node !== undefined) {
206 return {
207 kind: 'file',
208 nodeId: node.id,
209 name: displayNameOf(node),
210 qualifiedName: node.qualified_name ?? '',
211 uncertain: node.end_line === undefined,
212 why: '',
213 ghostIds: [],
214 testedNodeId: node.id,
215 };
216 }
217 }
218 if (path.length === 0) {
219 return {
220 kind: 'none',
221 name: '',
222 qualifiedName: '',
223 uncertain: false,
224 why: 'the command names no file this index knows',
225 ...empty,
226 };
227 }
228 }
229
230 if (path.length === 0) {
231 return {
232 kind: 'none',
233 name: '',
234 qualifiedName: '',
235 uncertain: false,
236 why: 'the event names no path',
237 ...empty,
238 };
239 }
240
241 const nodes = index.byPath.get(path);
242 if (nodes === undefined || nodes.length === 0) {
243 return {
244 kind: 'none',
245 name: '',
246 qualifiedName: '',
247 uncertain: false,
248 why: 'the index has no node for this path',
249 ...empty,
250 };

Callers 6

trailOfFunction · 0.90
burstsOfFunction · 0.90
viewOfFunction · 0.90
buildAgentsViewFunction · 0.90
ActivityPanelFunction · 0.90

Calls 8

testedPathOfFunction · 0.85
fileNodeOfFunction · 0.85
displayNameOfFunction · 0.85
ghostsForFunction · 0.85
spanOfFunction · 0.85
normalizePathFunction · 0.70
overlapsFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected