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.
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
/**
|
|
* Instructions Capability
|
|
*
|
|
* GitHub Copilot-style instructions with optional file pattern matching.
|
|
*/
|
|
import { defineCapability } from ".";
|
|
import type { SourceMeta } from "./types";
|
|
|
|
/**
|
|
* An instruction with optional file pattern matching.
|
|
*/
|
|
export interface Instruction {
|
|
/** Instruction name (derived from filename) */
|
|
name: string;
|
|
/** Absolute path to instruction file */
|
|
path: string;
|
|
/** Instruction content (markdown) */
|
|
content: string;
|
|
/** Glob pattern for files this applies to */
|
|
applyTo?: string;
|
|
/** Source metadata */
|
|
_source: SourceMeta;
|
|
}
|
|
|
|
export const instructionCapability = defineCapability<Instruction>({
|
|
id: "instructions",
|
|
displayName: "Instructions",
|
|
description: "File-specific instructions with glob pattern matching (GitHub Copilot format)",
|
|
key: inst => inst.name,
|
|
toExtensionId: inst => `instruction:${inst.name}`,
|
|
validate: inst => {
|
|
if (!inst.name) return "Missing name";
|
|
if (!inst.path) return "Missing path";
|
|
if (inst.content === undefined) return "Missing content";
|
|
return undefined;
|
|
},
|
|
});
|