/** * suggest-prompt plugin: after every completed agent turn, generate one * suggested next prompt for the user through a bounded auxiliary LLM call and * publish it as the `suggestPrompt` session projection (the web composer * renders it as ghost placeholder text). Host-driven on `turn/end` (completed); generation * is per-session deduplicated by turn and superseded on the next completed * turn. The projection unit activates only where a projection registry is * composed (headless assemblies stay unaffected). * @module @studyzy/dsh-suggest-prompt */ import type { Context } from '@deepseek-ai/cordis'; import z from '@deepseek-ai/schemastery'; import type { SessionEvent } from '@deepseek-ai/dsh-session'; import type { SuggestPromptSuggestion } from './types.ts'; export type * from './types.ts'; export type * from './domain.ts'; /** * Light last-wins fold of the `suggestPrompt` projection unit. The state is * plain JSON; any non-suggested event returns the same reference (the * registry's Object.is gate), and correctness of the written suggestion is * the write side's job (generateSuggestion sanitized and truncated it before * appending; the package invariant rejects a violating stream fail-loud where * it is installed). * @param state - the projection covering all prior events. * @param event - the next committed session event. * @returns the next projection (same reference when the event is not a suggestion). */ export declare function applySuggestPromptProjection(state: SuggestPromptSuggestion | null, event: SessionEvent): SuggestPromptSuggestion | null; /** Required LLM and session policy; this plugin adds no defaults. */ export interface Config { /** Maximum UTF-8 bytes in the final JSON-framed user prompt. */ readonly maxInputBytes: number; /** Auxiliary generation output-token cap. */ readonly maxOutputTokens: number; /** End-to-end auxiliary request deadline in milliseconds. */ readonly timeoutMs: number; /** Transcript tail keeps at most this many recent completed turns (default 1: only the last completed turn). */ readonly maxRecentTurns?: number; /** Transcript tail character budget before JSON framing. */ readonly maxTranscriptChars: number; /** Visible-character cap for the generated suggestion. */ readonly maxSuggestionChars: number; /** Optional explicit provider route; missing falls back to the session route. */ readonly provider?: string; /** Optional explicit model id; missing falls back to the session route. */ readonly model?: string; /** * Composer shortcut that accepts a displayed suggestion into the draft * (for example `Tab`, `Alt+Slash`, or `Ctrl+Enter`). Default `Tab`. */ readonly acceptKey?: string; } /** Loader schema: every bound is required and provider/model pair optionally overrides the logged route. */ export declare const Config: z; /** Cordis plugin identity. */ export declare const name = "suggest-prompt"; /** Services required before this plugin activates. */ export declare const inject: string[]; /** * The settings namespace owning the suggestion route. Editable from the WebUI * settings surface (`settings.plugin.item`, keyed by this value) and from * `~/.dsh/settings.yaml`; the cordis.yml entry remains the composition base. */ export declare const SUGGEST_PROMPT_NS: import("@deepseek-ai/dsh-settings").SettingsNamespace; /** * Mount the plugin: listen for completed turns, generate per-session * suggestions, and register the `suggestPrompt` projection unit. * @param ctx - context exposing the LLM and session services. * @param config - required bounded-generation policy. */ export declare function apply(ctx: Context, config: Config): void; //# sourceMappingURL=index.d.ts.map