b8e82008e3
- Added `toExtensionId()` method to all capability types for granular extension identification and disabling. - Added `disabledExtensions` and `includeDisabled` options to LoadOptions for filtering disabled capabilities by extension ID. - Added plugin manifest support for `extensions` entry points with automatic discovery from installed plugins. - Fixed skill loading to properly respect disabled skill names from custom directories. - Improved cross-platform path handling by using `path.basename()` instead of string splitting in context file and state manager. - Refactored capability index loading to validate source metadata and filter disabled extensions before processing.
35 lines
929 B
TypeScript
35 lines
929 B
TypeScript
/**
|
|
* Extension Modules Capability
|
|
*
|
|
* TypeScript/JavaScript extension modules loaded by the extension system.
|
|
*/
|
|
import { defineCapability } from ".";
|
|
import type { SourceMeta } from "./types";
|
|
|
|
/**
|
|
* A loaded extension module.
|
|
*/
|
|
export interface ExtensionModule {
|
|
/** Extension module name (derived from path) */
|
|
name: string;
|
|
/** Absolute path to extension entrypoint */
|
|
path: string;
|
|
/** Source level */
|
|
level: "user" | "project";
|
|
/** Source metadata */
|
|
_source: SourceMeta;
|
|
}
|
|
|
|
export const extensionModuleCapability = defineCapability<ExtensionModule>({
|
|
id: "extension-modules",
|
|
displayName: "Extension Modules",
|
|
description: "TypeScript/JavaScript extension modules loaded by the extension system",
|
|
key: ext => ext.name,
|
|
toExtensionId: ext => `extension-module:${ext.name}`,
|
|
validate: ext => {
|
|
if (!ext.name) return "Missing name";
|
|
if (!ext.path) return "Missing path";
|
|
return undefined;
|
|
},
|
|
});
|