Prune stale docs and update .hermes content
Delete a large set of outdated documentation (many files under docs/ and .hermes/plans/, including audits, design, prd, technical, planning, assets, and todos). Update and consolidate .hermes content: refresh shared-memory pages (decision-log, development-workflow, document-map, pitfalls, project-overview, team-conventions) and several skills/references under .hermes/skills. Also modify AGENTS.md, README.md, UI_CODING_STANDARD.md, docs/README.md and .encoding-check-ignore. Purpose: clean up stale planning/audit material and keep current hermes documentation and related top-level docs in sync.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import type { Match3DGeneratedItemAsset } from '../../packages/shared/src/contracts/match3dWorks';
|
||||
import type {
|
||||
Match3DGeneratedBackgroundAsset,
|
||||
Match3DGeneratedItemAsset,
|
||||
} from '../../packages/shared/src/contracts/match3dWorks';
|
||||
import { readAssetBytes, resolveAssetReadUrl } from './assetReadUrlService';
|
||||
|
||||
type CachedMatch3DModelBytes = {
|
||||
@@ -117,6 +120,30 @@ export function getMatch3DGeneratedImageAssetSources(
|
||||
];
|
||||
}
|
||||
|
||||
export function getMatch3DGeneratedRuntimeUiAssetSources(
|
||||
assets: readonly Match3DGeneratedItemAsset[] = [],
|
||||
backgroundAsset: Match3DGeneratedBackgroundAsset | null | undefined = null,
|
||||
) {
|
||||
return [
|
||||
...new Set(
|
||||
[
|
||||
backgroundAsset?.imageObjectKey,
|
||||
backgroundAsset?.imageSrc,
|
||||
backgroundAsset?.containerImageObjectKey,
|
||||
backgroundAsset?.containerImageSrc,
|
||||
...assets.flatMap((asset) => [
|
||||
asset.backgroundAsset?.imageObjectKey,
|
||||
asset.backgroundAsset?.imageSrc,
|
||||
asset.backgroundAsset?.containerImageObjectKey,
|
||||
asset.backgroundAsset?.containerImageSrc,
|
||||
]),
|
||||
]
|
||||
.map(normalizeMatch3DModelSource)
|
||||
.filter((source) => source.length > 0),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
export function hasMatch3DGeneratedImageAsset(
|
||||
assets: readonly Match3DGeneratedItemAsset[] | null | undefined,
|
||||
) {
|
||||
@@ -224,6 +251,7 @@ export function mergeMatch3DGeneratedItemAssetsForRuntime(
|
||||
return {
|
||||
...asset,
|
||||
itemName: asset.itemName.trim() || fallbackAsset.itemName,
|
||||
itemSize: asset.itemSize ?? fallbackAsset.itemSize ?? null,
|
||||
imageSrc: asset.imageSrc?.trim()
|
||||
? asset.imageSrc
|
||||
: (fallbackAsset.imageSrc ?? null),
|
||||
@@ -376,12 +404,26 @@ export async function preloadMatch3DGeneratedImageAssets(
|
||||
|
||||
export async function preloadMatch3DGeneratedRuntimeAssets(
|
||||
assets: readonly Match3DGeneratedItemAsset[] = [],
|
||||
backgroundAsset: Match3DGeneratedBackgroundAsset | null | undefined = null,
|
||||
options: Omit<Match3DModelBytesOptions, 'signal'> = {},
|
||||
) {
|
||||
// 中文注释:新抓大鹅运行态以 2D 图片为主;3D 模型只作为历史草稿预览兼容。
|
||||
await preloadMatch3DGeneratedImageAssets(
|
||||
normalizeMatch3DGeneratedItemAssetsForRuntime(assets),
|
||||
options,
|
||||
const normalizedAssets = normalizeMatch3DGeneratedItemAssetsForRuntime(assets);
|
||||
const sources = [
|
||||
...new Set([
|
||||
...getMatch3DGeneratedImageAssetSources(normalizedAssets),
|
||||
...getMatch3DGeneratedRuntimeUiAssetSources(
|
||||
normalizedAssets,
|
||||
backgroundAsset,
|
||||
),
|
||||
]),
|
||||
];
|
||||
await Promise.allSettled(
|
||||
sources.map((source) =>
|
||||
resolveAssetReadUrl(source, {
|
||||
expireSeconds: options.expireSeconds,
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user