namesIn
The definitions named directly in a namespace (not in namespaces under it): name → hash.
import type { CodebaseCore } from "#codebase/tcmts/cli/codebase"; export function namesIn(cb: CodebaseCore, ns: string): Record<string, string> { const out: Record<string, string> = {}; const prefix = ns ? `${ns}.` : ""; for (const n of cb.store.names()) { if (!n.path.startsWith(prefix)) continue; const leaf = n.path.slice(prefix.length); if (!leaf.includes(".")) out[leaf] = n.hash; } return out; }