@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)
useAgentBridge
export declare function useAgentBridge(options: UseAgentBridgeOptions): UseAgentBridgeReturn;Interfaces(10)
AgentChatLogProps
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 |
AgentComposerProps
export interface AgentComposerProps| Member | Type | Summary |
|---|---|---|
| className? | string | |
| disabled? | boolean | |
| modelValue | string | |
| placeholder? | string | |
| sendLabel? | string |
AgentPanelProps
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 |
AgentSuggestionChipProps
export interface AgentSuggestionChipProps| Member | Type | Summary |
|---|---|---|
| disabled? | boolean | |
| label | string |
AgentTimelineProps
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 |
AIResponsePreviewProps
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 |
EditorRefLike
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 |
|---|---|---|
| addComment | — | |
| applyFormatting | — | Apply character formatting to a paragraph or sub-range. Returns false on missing paraId / ambiguous search. |
| findInDocument | — | |
| getComments | — | |
| 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. |
| onContentChange | — | |
| onSelectionChange | — | |
| proposeChange | — | |
| replyToComment | — | |
| resolveComment | — | |
| scrollToParaId | — | |
| setParagraphStyle | — | Apply a paragraph style by styleId. Returns false if paraId is unknown. |
UseAgentBridgeOptions
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`). |
UseAgentBridgeReturn
export interface UseAgentBridgeReturn| Member | Type | Summary |
|---|---|---|
| executeToolCall | (toolName: string, input: Record<string, unknown>) => AgentToolResult | |
| toolSchemas | ReturnType<typeof getToolSchemas> |
Variables(7)
AgentChatLog
_default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>AgentComposer
_default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>AgentPanel
_default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>AgentSuggestionChip
_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>AgentTimeline
_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>AIResponsePreview
_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>