MCPcopy Create free account
hub / github.com/backnotprop/plannotator / enabledSourceSave

Function enabledSourceSave

packages/shared/source-save.ts:119–138  ·  view source on GitHub ↗
(
	scope: SourceSaveScope,
	filePath: string,
	snapshot: SourceFileSnapshot,
)

Source from the content-addressed store, hash-verified

117}
118
119export function enabledSourceSave(
120 scope: SourceSaveScope,
121 filePath: string,
122 snapshot: SourceFileSnapshot,
123): SourceSaveCapability {
124 const language = getSourceSaveLanguage(filePath);
125 if (!language) return disabledSourceSave("unsupported-extension");
126 return {
127 enabled: true,
128 kind: "local-text-file",
129 scope,
130 path: filePath,
131 basename: basenameFromPath(filePath),
132 language,
133 hash: snapshot.hash,
134 mtimeMs: snapshot.mtimeMs,
135 size: snapshot.size,
136 eol: snapshot.eol,
137 };
138}

Calls 3

getSourceSaveLanguageFunction · 0.85
disabledSourceSaveFunction · 0.85
basenameFromPathFunction · 0.85

Tested by

no test coverage detected