SettingsNav 7 个 tab 的 nav.* key(label/blurb)补齐中英文案;画布页 canvas/[id] 所有硬编码英文(toast、确认框、按钮 title、空态/错误提示)改为 t() 动态键;项目页 project/[id] 错误态、视频工作台按钮、队列状态接入 i18n;agents 页自动会话标题改用 t()(agent.task.*),移除静态 AGENT_TASK_TITLES;hooks.client.ts 全局兜底错误消息接入 i18n。en/zh 各 983 keys 键集完全对齐,svelte-check 0 errors。
35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
/**
|
|
* Canonical deep-link contract between the Project stages and the Agent chat.
|
|
*
|
|
* The Story ("Draft Storyline") and Script ("Regenerate Script") actions now
|
|
* hand off to a fresh, project-linked agent session with the composer
|
|
* pre-filled. Keeping the task → prompt mapping in one place means the stage
|
|
* buttons stay dumb and the wording never drifts out of sync.
|
|
*/
|
|
|
|
export type AgentTaskKind = 'story' | 'script';
|
|
|
|
/** The pre-filled composer prompt for each task. */
|
|
export const AGENT_TASK_PROMPTS: Record<AgentTaskKind, string> = {
|
|
story:
|
|
'Draft the storyline for this project — generate the beats, characters, environments, and any misc. items from the story idea.',
|
|
script:
|
|
'Regenerate the full script for this project — turn the storyline into ordered scenes with action and dialogue.',
|
|
};
|
|
|
|
/** i18n key for the auto-created session's sidebar title. */
|
|
export const AGENT_TASK_TITLE_KEYS: Record<AgentTaskKind, string> = {
|
|
story: 'agent.task.story',
|
|
script: 'agent.task.script',
|
|
};
|
|
|
|
export function isAgentTaskKind(value: string | null | undefined): value is AgentTaskKind {
|
|
return value === 'story' || value === 'script';
|
|
}
|
|
|
|
/** Build the /agents deep-link URL for a project-scoped task. */
|
|
export function agentDeepLink(projectId: number, task: AgentTaskKind): string {
|
|
const params = new URLSearchParams({ project: String(projectId), task });
|
|
return `/agents?${params.toString()}`;
|
|
}
|