MCPcopy Create free account
hub / github.com/Noumena-Network/code / trackFileCreation

Function trackFileCreation

src/utils/commitAttribution.ts:380–388  ·  view source on GitHub ↗
(
  state: AttributionState,
  filePath: string,
  content: string,
  mtime: number = Date.now(),
)

Source from the content-addressed store, hash-verified

378 * Used when NCode creates a new file through a non-tracked mechanism.
379 */
380export function trackFileCreation(
381 state: AttributionState,
382 filePath: string,
383 content: string,
384 mtime: number = Date.now(),
385): AttributionState {
386 // A creation is simply a modification from empty to the new content
387 return trackFileModification(state, filePath, '', content, false, mtime)
388}
389
390/**
391 * Track a file deletion by NCode (e.g., via bash rm command).

Callers

nothing calls this directly

Calls 1

trackFileModificationFunction · 0.85

Tested by

no test coverage detected