(input: {
manifest: ProjectsManifest;
activeProjects: string[];
})
| 163 | * duplicate error, not a runtime precedence decision). |
| 164 | */ |
| 165 | export function resolveProjectResourceNamespaces(input: { |
| 166 | manifest: ProjectsManifest; |
| 167 | activeProjects: string[]; |
| 168 | }): Record<ProjectResourceType, string[]> { |
| 169 | const resolved = input.activeProjects.map((id) => getProjectOrThrow(input.manifest, id)); |
| 170 | |
| 171 | const namespaces: Record<ProjectResourceType, string[]> = { |
| 172 | knowledge: [], |
| 173 | skills: [], |
| 174 | learnings: [], |
| 175 | }; |
| 176 | |
| 177 | for (const type of PROJECT_RESOURCE_TYPES) { |
| 178 | const seen = new Set<string>(); |
| 179 | for (const project of resolved) { |
| 180 | for (const namespace of project.resources[type]) { |
| 181 | if (seen.has(namespace)) continue; |
| 182 | seen.add(namespace); |
| 183 | namespaces[type].push(namespace); |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | return namespaces; |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Resolve the active **learnings** namespaces for a directory, from the manifest |
no test coverage detected