Files
oh-my-pi/packages/coding-agent/src/capability/extension.ts
T
can1357 779ca4872b style(deps): migrated from Prettier to Biome and updated formatting rules
- Removed Prettier configuration files (.prettierignore and .prettierrc) and migrated formatting to Biome.
- Updated Biome configuration from version 2.3.11 to 2.3.12 and changed arrowParentheses rule from 'always' to 'asNeeded'.
- Pinned @biomejs/biome dependency to exact version 2.3.12 in package.json and bun.lock.
- Applied consistent arrow function formatting across 489 files by removing unnecessary parentheses around single parameters.
- Removed blank lines after comment blocks and reorganized imports for consistency across the codebase.
2026-01-24 04:20:19 +01:00

48 lines
1.2 KiB
TypeScript

/**
* Extensions Capability
*
* Gemini-style extensions that provide MCP servers, tools, and context.
*/
import { defineCapability } from ".";
import type { MCPServer } from "./mcp";
import type { SourceMeta } from "./types";
/**
* Extension manifest structure.
*/
export interface ExtensionManifest {
name?: string;
description?: string;
mcpServers?: Record<string, Omit<MCPServer, "name" | "_source">>;
tools?: unknown[];
context?: unknown;
}
/**
* A loaded extension.
*/
export interface Extension {
/** Extension name (from manifest.name or directory name) */
name: string;
/** Absolute path to extension directory */
path: string;
/** Parsed manifest data */
manifest: ExtensionManifest;
/** Source level */
level: "user" | "project";
/** Source metadata */
_source: SourceMeta;
}
export const extensionCapability = defineCapability<Extension>({
id: "extensions",
displayName: "Extensions",
description: "Gemini-style extensions providing MCP servers, tools, and context",
key: ext => ext.name,
validate: ext => {
if (!ext.name) return "Missing extension name";
if (!ext.path) return "Missing extension path";
return undefined;
},
});