docs(scope,agent-presets): standing-mount model, parent chain, and the Agent Note

This commit is contained in:
Yichen Jiang
2026-08-08 18:08:20 +08:00
parent e18aa2745c
commit d770fb21cc
13 changed files with 111 additions and 36 deletions

View File

@@ -190,10 +190,9 @@ export class ScopedLayers<L extends ScopeLayer> {
* @returns the existing layers, nearest last; absent overlays are skipped.
*/
chainLayers(scope: ScopeKey | undefined): L[] {
const chain = scopeChainOf(scope)
const layers: L[] = []
for (let index = chain.length - 1; index >= 0; index -= 1) {
const layer = this.scoped.get(chain[index]!)
for (const key of scopeChainOf(scope).reverse()) {
const layer = this.scoped.get(key)
if (layer !== undefined) layers.push(layer)
}
return layers