import { type FuncType, type Token, type Type } from '@frontmcp/di'; import { type AuthInfo, type GetPromptResult } from '@frontmcp/protocol'; import { type RuntimeContext } from '@frontmcp/utils'; import { type ScopeEntry } from '../entries'; import { type PromptMetadata } from '../metadata'; import { type ProviderRegistryInterface } from './internal'; import { type FrontMcpLogger } from './logger.interface'; export interface PromptInterface { execute(args: Record): Promise; } /** * Functional prompt pattern - returned by prompt() builder. * A callable that returns an execute handler, with metadata attached. */ export type FunctionalPromptType = (() => any) & { [key: symbol]: unknown; }; export type PromptType = Type | FuncType | FunctionalPromptType | string; type HistoryEntry = { at: number; stage?: string; value: T | undefined; note?: string; }; export type PromptCtorArgs = { metadata: PromptMetadata; args: Record; providers: ProviderRegistryInterface; logger: FrontMcpLogger; authInfo: AuthInfo; }; export declare abstract class PromptContext { private providers; readonly authInfo: AuthInfo; protected readonly runId: string; protected readonly promptId: string; protected readonly promptName: string; readonly metadata: PromptMetadata; protected readonly logger: FrontMcpLogger; /** The arguments passed to the prompt */ readonly args: Record; protected activeStage: string; private _output?; private _error?; private readonly _outputHistory; constructor(ctorArgs: PromptCtorArgs); abstract execute(args: Record): Promise; get(token: Token): T; get scope(): ScopeEntry; tryGet(token: Token): T | undefined; get output(): GetPromptResult | undefined; set output(v: GetPromptResult | undefined); get outputHistory(): ReadonlyArray>; respond(value: GetPromptResult): never; /** Get the error that caused the prompt to fail, if any. */ get error(): Error | undefined; /** Fail the run (invoker will run error/finalize). */ protected fail(err: Error): never; mark(stage: string): void; /** Get the current runtime context (platform, runtime, deployment, env). */ get runtimeContext(): RuntimeContext; /** Check if running on a specific OS platform. */ isPlatform(platform: RuntimeContext['platform']): boolean; /** Check if running in a specific JavaScript runtime. */ isRuntime(runtime: RuntimeContext['runtime']): boolean; /** Check if running in a specific deployment mode. */ isDeployment(deployment: RuntimeContext['deployment']): boolean; /** Check if running in a specific environment. */ isEnv(env: RuntimeContext['env']): boolean; } export {}; //# sourceMappingURL=prompt.interface.d.ts.map