histoire
Version:
A fast story book powered by Vite
38 lines • 1.99 kB
TypeScript
import type { UiAgentThreadBase, UiCommentAttachment } from '@histoire/shared';
import type { PromptFile } from '../acp/prompt-blocks.js';
/**
* Text the user just sent: latest user reply, or the first message when none.
* @param comment Thread being dispatched.
*/
export declare function latestUserBody(comment: UiAgentThreadBase): string;
/**
* Whether the message being sent is an agent slash command, sent raw instead of wrapped.
* Only a leading `/name` the agent announced counts, so text like "/api returns 500"
* stays a normal message.
* @param comment Comment being dispatched.
* @param commands Announced command names, with or without the leading slash.
*/
export declare function isCommentCommand(comment: UiAgentThreadBase, commands: readonly string[]): boolean;
/**
* Every attachment in the conversation, so a new agent session after restart sees them all.
* @param comment Comment being dispatched.
*/
export declare function commentAttachments(comment: UiAgentThreadBase): UiCommentAttachment[];
/**
* `@path` mentions of indexed project files, in order and without duplicates.
* @param body User-authored text.
* @param files Indexed project-relative paths.
* @param limit Maximum mentions.
*/
export declare function extractMentions(body: string, files: ReadonlySet<string>, limit?: number): string[];
/**
* Uploads and indexed `@` mentions of the whole conversation. Files of earlier user
* messages are flagged `earlier`, so an agent session that already saw them can skip
* them; the latest user message's files are never flagged. A file referenced both
* earlier and in the latest message counts as latest.
* @param comment Comment or thread being dispatched.
* @param files Indexed project-relative paths.
* @param limit Maximum mentioned files, latest message first.
*/
export declare function commentPromptFiles(comment: UiAgentThreadBase, files: ReadonlySet<string>, limit?: number): PromptFile[];
//# sourceMappingURL=prompt.d.ts.map