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

Function getWebAssetCacheRoot

apps/kimi-code/src/native/web-assets.ts:142–161  ·  view source on GitHub ↗
(
  manifest: WebAssetManifest,
  options: WebAssetOptions = {},
)

Source from the content-addressed store, hash-verified

140}
141
142export function getWebAssetCacheRoot(
143 manifest: WebAssetManifest,
144 options: WebAssetOptions = {},
145): string {
146 const version = sanitizeSegment(options.version ?? KIMI_BUILD_INFO.version ?? 'dev');
147 const manifestHash = sha256(JSON.stringify(manifest));
148 return join(
149 getNativeCacheBase({
150 cacheBase: options.cacheBase,
151 env: options.env,
152 platform: options.platform,
153 homeDir: options.homeDir,
154 }),
155 'web',
156 version,
157 sanitizeSegment(manifest.target),
158 manifestHash,
159 manifest.root,
160 );
161}
162
163export function getNativeWebAssetsDir(options: WebAssetOptions = {}): string | null {
164 const source = options.source ?? getSeaAssetSource();

Callers 2

web-assets.test.tsFile · 0.90
getNativeWebAssetsDirFunction · 0.85

Calls 3

getNativeCacheBaseFunction · 0.90
sanitizeSegmentFunction · 0.70
sha256Function · 0.70

Tested by

no test coverage detected