返回 oh-my-ppt
types.ts
根目录 / src / main / agent-runtime / agent / types.ts
1 import type {
2 AnimationPreferencesPayload,
3 DeckEditScope,
4 DesignContract,
5 OutlineItem,
6 SelectedElementRuntimeContext
7 } from '@shared/generation'
8 import type { SlideSizePreset } from '@shared/slide-size'
9
10 export interface DeepAgentStreamResult {
11 stream: (...args: any[]) => Promise<AsyncIterable<unknown>>
12 }
13
14 /** Immutable session/run input shared by the Agent factory, prompt composers, and tool adapters. */
15 export interface SessionDeckGenerationContext {
16 mode?: 'generate' | 'edit' | 'retry'
17 editScope?: DeckEditScope
18 provider?: string
19 model?: string
20 sessionId: string
21 projectDir: string
22 indexPath: string
23 pageFileMap: Record<string, string>
24 pageNumbers?: Record<string, number>
25 selectPageIds?: string[]
26 allowedPageIds?: string[]
27 topic: string
28 deckTitle: string
29 styleId: string | null | undefined
30 /** Snapshot of the database styleSkill markdown for this run. */
31 styleSkillPrompt?: string
32 styleKey?: string
33 styleName?: string
34 styleVersion?: string
35 slideSize: SlideSizePreset
36 appLocale?: 'zh' | 'en'
37 animationPreferences?: AnimationPreferencesPayload | null
38 userMessage: string
39 outlineTitles: string[]
40 outlineItems: OutlineItem[]
41 sourceDocumentPaths?: string[]
42 designContract?: DesignContract
43 /** Template generation must inspect the copied template page before rewriting it. */
44 templatePageReadRequired?: boolean
45 // Edit-mode fields (filled when mode=edit)
46 selectedPageId?: string
47 selectedPageNumber?: number
48 selectedSelector?: string
49 elementTag?: string
50 elementText?: string
51 selectedElementContext?: SelectedElementRuntimeContext
52 existingPageIds?: string[]
53 }
54
54 lines TYPESCRIPT