MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / getNativeAssetCacheRoot

Function getNativeAssetCacheRoot

apps/kimi-code/src/native/native-assets.ts:158–171  ·  view source on GitHub ↗
(
  manifest: NativeAssetManifest,
  options: NativeAssetOptions = {},
)

Source from the content-addressed store, hash-verified

156}
157
158export function getNativeAssetCacheRoot(
159 manifest: NativeAssetManifest,
160 options: NativeAssetOptions = {},
161): string {
162 const version = sanitizeSegment(options.version ?? KIMI_BUILD_INFO.version ?? 'dev');
163 const manifestHash = sha256(JSON.stringify(manifest));
164 return join(
165 getNativeCacheBase(options),
166 'native',
167 version,
168 sanitizeSegment(manifest.target),
169 manifestHash,
170 );
171}
172
173function readFileSha256(path: string): string | null {
174 try {

Callers 2

ensureNativeAssetTreeFunction · 0.85

Calls 3

getNativeCacheBaseFunction · 0.85
sanitizeSegmentFunction · 0.70
sha256Function · 0.70

Tested by

no test coverage detected