Skip to content

Commit 12fbf54

Browse files
committed
fix: use descriptor.type instead of isUnified for source dir detection
The isUnified field was never set on plugin descriptors. Singlerepo plugins have content directories in package root, monorepo plugins have them in .opencode/ subdirectory. Now correctly uses descriptor.type to determine the source directory path.
1 parent 3d15bb1 commit 12fbf54

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

lib/linker.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,23 @@ export function normalizeContentType(type) {
6868
/**
6969
* Gets source directory for a plugin based on type.
7070
*
71-
* For unified plugins: content is in package root (agent/, command/, etc.)
72-
* For legacy plugins: content is in .opencode/ subdirectory
71+
* For singlerepo plugins: content is in package root (agents/, commands/, etc.)
72+
* For monorepo plugins: content is in .opencode/ subdirectory
7373
*
7474
* @param {PluginDescriptor} descriptor - Plugin descriptor
75-
* @param {string} type - Content type (agent, command, skill, etc.)
75+
* @param {string} type - Content type (agents, commands, skills, etc.)
7676
* @returns {string|null} Source directory path or null if not exists
7777
*/
7878
export function getSourceDir(descriptor, type) {
7979
if (!descriptor.contentTypes.includes(type)) {
8080
return null;
8181
}
8282

83-
if (descriptor.isUnified) {
84-
// Unified plugin: content in package root
83+
if (descriptor.type === 'singlerepo') {
84+
// Singlerepo plugin: content in package root
8585
return path.join(descriptor.rootDir, type);
8686
} else {
87-
// Legacy plugin: content in .opencode/ subdirectory
87+
// Monorepo plugin: content in .opencode/ subdirectory
8888
return path.join(descriptor.rootDir, '.opencode', type);
8989
}
9090
}

0 commit comments

Comments
 (0)