Quick start
What it is
AI Actions is SuperDoc’s high-level AI offering. It provides pre-built operations for common document automation tasks: UseinsertTrackedChange when edits should be reviewed (e.g. legal or branding updates); use replace for final text changes.
- AI-powered search, rewrites, and summaries
- Tracked changes and comments created by an AI assistant
- Bulk edits and repetitive automation
- Multi-provider support (OpenAI, Anthropic, custom)
Capabilities
- Natural-language operations - Find, replace, highlight, and manipulate content using plain English
- Formatting-safe edits - Keeps existing Word headings, custom styles, and document structure intact while modifying text
- Tracked changes & comments - AI-generated edits attributed to your configured AI user
- Summaries & completions - Generate summaries or free-form content with streaming support
- Provider-agnostic - Works with OpenAI, Anthropic, custom HTTP gateways, or custom providers
- Lifecycle hooks - Real-time callbacks for streaming, errors, and readiness
- AI Planner - Multi-step AI workflows with planning and execution capabilities
- Advanced utilities - Lower-level exports for custom implementations and tool management
Lifecycle & readiness
waitUntilReady, so explicit checks are only required when guarding UI or retry flows.
Error handling
enableLogging: true. The package will emit parsing and traversal issues to console.error.
Advanced Exports
The package exports additional utilities for advanced use cases:Provider Factory
AI Planner
For multi-step AI workflows with planning capabilities:Service Classes
For custom implementations, you can use the lower-level service classes:AIActionsService- Core service class that provides AI-powered document actionsEditorAdapter- Adapter for SuperDoc editor operations, encapsulating editor-specific API calls
Tool Utilities
Utilities for working with AI tools:Type Exports
The package exports comprehensive TypeScript types including:AIPlannerConfig,AIPlannerExecutionResult,AIPlan- Planner typesAIToolActions,SelectionRange,SelectionSnapshot- Tool and selection typesAIProviderInput,OpenAIProviderConfig,AnthropicProviderConfig,HttpProviderConfig- Provider configuration typesPlannerContextSnapshot,BuilderPlanResult- Advanced workflow types
Documentation
- Configuration - Provider setup and configuration options
- Methods - Instance methods and AI actions
- Hooks - Lifecycle and streaming callbacks

