histoire
Version:
A fast story book powered by Vite
41 lines • 1.8 kB
TypeScript
import type { UiAiThread, UiPinnedAiThread } from '@histoire/shared';
import type { Context } from '../context.js';
import type { AiProjectContext } from './project-context.js';
/**
* Structured story context for ACP privacy policy; absent without a story chip.
* @param thread Thread being dispatched.
* @param ctx Dev context resolving the story file.
*/
export declare function aiThreadContext(thread: UiAiThread, ctx: Context): {
storyId: string;
variantId: string;
source: string;
};
/**
* Task text with project story conventions so the agent writes collectable stories.
* Slash commands are sent raw, as agents only recognize them at the start.
* @param thread Thread being dispatched.
* @param project Story conventions of the project.
* @param commands Slash command names the agent announced.
*/
export declare function aiThreadPrompt(thread: UiAiThread, project: AiProjectContext, commands: readonly string[]): string;
/**
* Structured canvas context of a pinned thread, kept separate so ACP privacy toggles remain authoritative.
* @param thread Pinned thread being dispatched.
* @param relativePath Project-relative story file.
*/
export declare function commentAgentContext(thread: UiPinnedAiThread, relativePath: string): {
storyId: string;
variantId: string;
props: Record<string, unknown>;
selector: string;
screenshot: string;
source: string;
};
/**
* Canvas comment task text; it never preembeds source/props/screenshots outside ACP privacy policy.
* @param thread Pinned thread being dispatched.
* @param commands Slash command names the agent announced; see {@link isCommentCommand}.
*/
export declare function commentPrompt(thread: UiPinnedAiThread, commands: readonly string[]): string;
//# sourceMappingURL=prompt.d.ts.map