@eigenpal/docx-editor-agents/vue
Vue entry. Components and composables that need Vue as a peer dependency.
Parity with the React adapter: same prop and event names where possible. Where React passes ReactNode props (icon, emptyState, footnote), the Vue components use idiomatic named slots. See each component's JSDoc for the slot list. AgentComposer follows the standard Vue 3 v-model contract (modelValue / update:modelValue).
Editor i18n: <DocxEditor :i18n="..." /> does NOT translate agent UI strings. These components own their own English defaults from packages/agents/i18n/en.json. Wire your t() results to the *Label / labels props for translation:
vue
<AgentPanel :title="t('agentPanel.defaultTitle')" :close-label="t('agentPanel.close')" />
export declare function useAgentBridge(options: UseAgentBridgeOptions): UseAgentBridgeReturn;
export interface AgentChatLogProps
| Member | Type | Summary |
|---|
| autoScroll? | boolean | |
| className? | string | |
| earlierLabel? | (count: number) => string | |
| error? | string | null | |
| humanizeToolName? | (name: string) => string | |
| loading? | boolean | |
| maxVisibleCalls? | number | |
| messages | AgentMessage[] | |
| summaryLabel? | (count: number) => string | |
| thinkingLabel? | string | |
| workingLabel? | (count: number) => string | |
export interface AgentComposerProps
| Member | Type | Summary |
|---|
| className? | string | |
| disabled? | boolean | |
| modelValue | string | |
| placeholder? | string | |
| sendLabel? | string | |
export interface AgentPanelProps
| Member | Type | Summary |
|---|
| className? | string | |
| closable? | boolean | Show the header close button. Vue parity for React's `onClose=undefined → no button` pattern: pass `:closable="false"` to hide. Defaults to `true` because Vue's `defineEmits` always declares the `close` event regardless of whether the parent attached `@close`. |
| closed? | boolean | |
| closeLabel? | string | |
| defaultWidth? | number | |
| maxWidth? | number | |
| minWidth? | number | |
| resizeHandleLabel? | string | |
| title? | string | |
| width? | number | |
export interface AgentSuggestionChipProps
| Member | Type | Summary |
|---|
| disabled? | boolean | |
| label | string | |
export interface AgentTimelineProps
| Member | Type | Summary |
|---|
| earlierLabel? | (count: number) => string | |
| humanizeName? | (name: string) => string | |
| maxVisibleCalls? | number | |
| streaming? | boolean | |
| summaryLabel? | (count: number) => string | |
| toolCalls | AgentToolCall[] | |
| workingLabel? | (count: number) => string | |
export interface AIContextMenuProps
export interface AIResponsePreviewProps
| Member | Type | Summary |
|---|
| action | string | |
| allowEdit? | boolean | |
| error? | string | |
| isLoading | boolean | |
| isVisible | boolean | |
| labels? | AIResponsePreviewLabels | |
| originalText | string | |
| responseText | string | |
| showDiff? | boolean | |
| showRetry? | boolean | |
Agent-bridge contract every editor adapter (React, Vue, future) MUST satisfy. Versioning: additions are coordinated minor bumps across the fixed group; signature changes / removals are major. See openspec/changes/vue-editor-robust-implementation/design.md Decision 18.
interface EditorRefLike
| Member | Type | Summary |
|---|
| applyFormatting | | Apply character formatting to a paragraph or sub-range. Returns false on missing paraId / ambiguous search. |
| findInDocument | | |
| getCurrentPage | | 1-indexed page the user's cursor / selection is on. 0 if unknown. |
| getDocument | | |
| getEditorRef | | |
| getPageContent | | Read a single page's paragraphs (1-indexed). Returns null if the page does not exist. |
| getSelectionInfo | | |
| getTotalPages | | Total number of pages currently rendered. |
| insertBreak | | Insert a page or section break after the paragraph. Returns false if paraId is unknown. |
| onContentChange | | |
| onSelectionChange | | |
| proposeChange | | |
| scrollToParaId | | |
| setParagraphStyle | | Apply a paragraph style by styleId. Returns false if paraId is unknown. |
export interface UseAgentBridgeOptions
| Member | Type | Summary |
|---|
| author? | MaybeRef<string> | Default author for comments and tracked changes. Accepts a plain string or a `Ref<string>`/computed — bridge rebuilds when the value changes (matches React's `useMemo([editorRef, author])` shape). Defaults to `'AI'`. |
| editorRef | Ref<EditorRefLike | null | undefined> | Vue ref pointing at the DocxEditor instance (must match `EditorRefLike`). |
export interface UseAgentBridgeReturn
| Member | Type | Summary |
|---|
| executeToolCall | (toolName: string, input: Record<string, unknown>) => AgentToolResult | |
| toolSchemas | ReturnType<typeof getToolSchemas> | |
_default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>
_default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>
_default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>
_default: import('vue').DefineComponent<AgentSuggestionChipProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
click: () => any;
}, string, import('vue').PublicProps, Readonly<AgentSuggestionChipProps> & Readonly<{
onClick?: (() => any) | undefined;
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>
_default: import('vue').DefineComponent<AgentTimelineProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AgentTimelineProps> & Readonly<{}>, {
streaming: boolean;
maxVisibleCalls: number;
humanizeName: (name: string) => string;
workingLabel: (count: number) => string;
summaryLabel: (count: number) => string;
earlierLabel: (count: number) => string;
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>
_default: import('vue').DefineComponent<AIContextMenuProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
close: () => any;
action: (action: string, customPrompt?: string | undefined) => any;
}, string, import('vue').PublicProps, Readonly<AIContextMenuProps> & Readonly<{
onClose?: (() => any) | undefined;
onAction?: ((action: string, customPrompt?: string | undefined) => any) | undefined;
}>, {
showCustomPrompt: boolean;
labels: AIContextMenuLabels;
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>
_default: import('vue').DefineComponent<AIResponsePreviewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
accept: (text: string) => any;
reject: () => any;
retry: () => any;
}, string, import('vue').PublicProps, Readonly<AIResponsePreviewProps> & Readonly<{
onAccept?: ((text: string) => any) | undefined;
onReject?: (() => any) | undefined;
onRetry?: (() => any) | undefined;
}>, {
error: string;
labels: AIResponsePreviewLabels;
allowEdit: boolean;
showDiff: boolean;
showRetry: boolean;
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>