New

docx-editor 1.x has shipped. Vue support, i18n, agents. Read the migration guide →

API Referencev1.0.2

@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')" /> ```

Functions(1)

export declare function useAgentBridge(options: UseAgentBridgeOptions): UseAgentBridgeReturn;

Interfaces(10)

export interface AgentChatLogProps
MemberTypeSummary
autoScroll?boolean
className?string
earlierLabel?(count: number) => string
error?string | null
humanizeToolName?(name: string) => string
loading?boolean
maxVisibleCalls?number
messagesAgentMessage[]
summaryLabel?(count: number) => string
thinkingLabel?string
workingLabel?(count: number) => string
export interface AgentComposerProps
MemberTypeSummary
className?string
disabled?boolean
modelValuestring
placeholder?string
sendLabel?string
export interface AgentPanelProps
MemberTypeSummary
className?string
closable?booleanShow 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
MemberTypeSummary
disabled?boolean
labelstring
export interface AgentTimelineProps
MemberTypeSummary
earlierLabel?(count: number) => string
humanizeName?(name: string) => string
maxVisibleCalls?number
streaming?boolean
summaryLabel?(count: number) => string
toolCallsAgentToolCall[]
workingLabel?(count: number) => string
interface

AIContextMenuProps

export interface AIContextMenuProps
MemberTypeSummary
isOpenboolean
labels?AIContextMenuLabels
position{ x: number; y: number; }
selectedTextstring
showCustomPrompt?boolean
interface

AIResponsePreviewProps

export interface AIResponsePreviewProps
MemberTypeSummary
actionstring
allowEdit?boolean
error?string
isLoadingboolean
isVisibleboolean
labels?AIResponsePreviewLabels
originalTextstring
responseTextstring
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
MemberTypeSummary
addComment
applyFormattingApply character formatting to a paragraph or sub-range. Returns false on missing paraId / ambiguous search.
findInDocument
getComments
getCurrentPage1-indexed page the user's cursor / selection is on. 0 if unknown.
getDocument
getEditorRef
getPageContentRead a single page's paragraphs (1-indexed). Returns null if the page does not exist.
getSelectionInfo
getTotalPagesTotal number of pages currently rendered.
onContentChange
onSelectionChange
proposeChange
replyToComment
resolveComment
scrollToParaId
setParagraphStyleApply a paragraph style by styleId. Returns false if paraId is unknown.
export interface UseAgentBridgeOptions
MemberTypeSummary
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'`.
editorRefRef<EditorRefLike | null | undefined>Vue ref pointing at the DocxEditor instance (must match `EditorRefLike`).
export interface UseAgentBridgeReturn
MemberTypeSummary
executeToolCall(toolName: string, input: Record<string, unknown>) => AgentToolResult
toolSchemasReturnType<typeof getToolSchemas>

Variables(7)

_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>