import type { AgentTool } from "@elyracode/agent-core"; import { type Static, Type } from "typebox"; import type { ToolDefinition } from "../extensions/types.js"; declare const extensionWriteSchema: Type.TObject<{ name: Type.TString; description: Type.TString; code: Type.TString; scope: Type.TOptional, Type.TLiteral<"project">]>>; }>; export type ExtensionWriteToolInput = Static; export interface ExtensionWriteToolDetails { name: string; scope: "user" | "project"; path: string | null; saved: boolean; rejected?: boolean; } /** Pluggable operations for the extension-write tool (overridable for tests). */ export interface ExtensionWriteOperations { writeFile: (absolutePath: string, content: string) => Promise; mkdir: (dir: string) => Promise; exists: (path: string) => boolean; } export interface ExtensionWriteToolOptions { /** Directory for user-scoped extensions (e.g. ~/.elyra/agent/extensions). */ userExtensionsDir: string; /** Directory for project-scoped extensions (e.g. /.elyra/extensions). */ projectExtensionsDir: string; /** Whether auto-extensions is enabled. Read fresh per call so toggles take effect immediately. */ getAutoExtensions: () => boolean; /** Custom operations (default: local filesystem). */ operations?: ExtensionWriteOperations; } /** Validate an extension name. Returns an error message, or null if valid. */ export declare function validateExtensionName(name: string): string | null; /** Validate an extension description. Returns an error message, or null if valid. */ export declare function validateExtensionDescription(description: string): string | null; /** * Validate that the code looks like a loadable extension: it must have a * default export. Returns an error message, or null if valid. */ export declare function validateExtensionCode(code: string): string | null; export declare function createExtensionWriteToolDefinition(options: ExtensionWriteToolOptions): ToolDefinition; export declare function createExtensionWriteTool(options: ExtensionWriteToolOptions): AgentTool; export {}; //# sourceMappingURL=extension-write.d.ts.map