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