- 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.
36 lines
922 B
TypeScript
36 lines
922 B
TypeScript
/**
|
|
* Prompts Capability
|
|
*
|
|
* Reusable prompt templates (Codex format) available via /prompts: menu.
|
|
*/
|
|
import { defineCapability } from ".";
|
|
import type { SourceMeta } from "./types";
|
|
|
|
/**
|
|
* A reusable prompt template.
|
|
*/
|
|
export interface Prompt {
|
|
/** Prompt name (filename without extension) */
|
|
name: string;
|
|
/** Absolute path to prompt file */
|
|
path: string;
|
|
/** Prompt content (markdown) */
|
|
content: string;
|
|
/** Source metadata */
|
|
_source: SourceMeta;
|
|
}
|
|
|
|
export const promptCapability = defineCapability<Prompt>({
|
|
id: "prompts",
|
|
displayName: "Prompts",
|
|
description: "Reusable prompt templates available via /prompts: menu",
|
|
key: prompt => prompt.name,
|
|
toExtensionId: prompt => `prompt:${prompt.name}`,
|
|
validate: prompt => {
|
|
if (!prompt.name) return "Missing name";
|
|
if (!prompt.path) return "Missing path";
|
|
if (prompt.content === undefined) return "Missing content";
|
|
return undefined;
|
|
},
|
|
});
|