Overview
The Allternit Office Add-in is a family of host-specific Microsoft Office task pane add-ins that connect Word, Excel, and PowerPoint to the Allternit platform brain. Each host is a separate product — Allternit for Word, Allternit for Excel, and Allternit for PowerPoint — with its own manifest, ribbon identity, installation health, and specialized tool surface. When the add-in loads inside a real Microsoft Office runtime, it uses Office.js to read and mutate the live document. If Office.js is not present (for example, in a browser preview), the pane renders as a companion preview and never reports a false live-document connection. The add-in reuses the sameExtensionSidepanelShell as the Allternit Chrome extension, so users get a consistent, branded experience across every surface.
Allternit for Word
Rewrite text with tracked changes, improve grammar, summarize documents, create tables, fill templates, and redline contracts.
Allternit for Excel
Analyze data, generate formulas, create charts, build financial models, clean data, and format ranges.
Allternit for PowerPoint
Add slides, rewrite content, generate full decks from outlines, apply branding, and create speaker notes.
Capabilities by Office host
Development quick start
The add-in is developed in debug / sideload mode. Marketplace certification is not part of the current launch path.1. Install dependencies
2. Install HTTPS certificates (one-time)
Office refuses to load HTTP task panes. Generate trusted localhost certificates before the first run:3. Start for a specific Office host
4. Stop debugging
office-addin-debugging — the Office equivalent of Chrome’s Load unpacked.
Architecture
Production topology
In production, the real Microsoft Word, Excel, and PowerPoint runtimes are hosted by Microsoft — not by Allternit. The add-in is a connector surface; the platform is a companion and control surface.Document binding contract
The canonical binding links an Office document to an Allternit workspace and project. Both the task pane and the gateway must agree on this schema.Office.settings / localStorage today; server persistence is provided by the gateway at /api/v1/office/bootstrap and /api/v1/office/runtime/state.
Plugin system per host
Each Office host has a dedicated plugin underplugins/{excel,powerpoint,word}/:
src/lib/plugin-loader.ts) automatically selects the correct plugin based on the active Office app, then injects the system prompt, execution rules, and command list into every AI conversation.
Per-host plugin config
Example plugin command list (Word)
Code execution
The add-in can execute Office.js code generated by the AI. Two gates control execution.Structured execution
Most tool calls are converted to Office.js code bybuildToolCallCode() in src/lib/tool-dispatcher.ts. The templates are trusted, arguments are escaped, and the resulting code runs through executeStructuredCode(). This path is always allowed but still passes through the security validator in src/lib/code-validator.ts as defense in depth.
Freeform execution
Freeform code extracted directly from an AI text response runs throughexecuteCode() in src/lib/code-executor.ts. Because it is evaluated with new Function(), this path is default-denied. Users must explicitly opt in via a persisted setting (allternit.addin.allowFreeformCode).
Security validation
src/lib/code-validator.ts blocks dangerous patterns on both paths:
Error categories
src/lib/code-executor.ts categorizes failures so the agent can self-correct:
OfficeCLI backend gateway
For work that Office.js cannot do efficiently — full-document rendering, structural analysis, schema validation, atomic batch edits, template merge, and new-document generation — the add-in offloads to OfficeCLI. OfficeCLI is a single-binary Office engine that runs server-side inside the Allternit API gateway (cmd/allternit-api, port 8013).
How snapshot sync works
- The add-in exports the live document with
Office.getFileAsync(compressed.docx/.xlsx/.pptxbytes, sliced). - The binary body is uploaded to
POST /api/v1/office/cli/document. - All
officeclitools run against that server-side snapshot. - After any Office.js mutation, the snapshot is marked dirty and lazily re-synced.
Gateway routes
All routes are under/api/v1/office/cli/ and inherit auth from the protected router.
Tool surface
Operational requirements
officeclimust be installed on the gateway host (brew install officeclior the official installer); override withOFFICECLI_BIN.- Production should disable auto-update:
officecli config autoUpdate false. ALLTERNIT_OFFICECLI_LIVE_FSgates direct file-path editing (default on only for local dev).- Upload body limit is 64 MiB on
POST /document.
Desktop add-in manager lifecycle
Allternit Desktop owns the developer-registration lifecycle throughoffice-addin-manager.ts:
- detect
- install
- update
- repair
- remove
Installation paths
Health states
Install, repair, update, and remove can be performed independently for each host.
Manifest generation
scripts/build-manifest.mjs generates three stable, host-specific manifests:
manifests/word.xml(Document)manifests/excel.xml(Workbook)manifests/powerpoint.xml(Presentation)
manifest.xml is retained only as a Word compatibility alias for legacy local tooling.
Environment variables
Each manifest points to a host-specific task pane URL:
?product= query identifies the companion preview; a live Office.js host is still required before the pane reports document access.
Deployment
Prepare production assets
deployment/office-addins/ at ALLTERNIT_OFFICE_APP_BASE_URL. Never publish a development build whose manifests point at localhost.
Release checks
- Build the task pane with the production base path.
- Validate all three XML manifests.
- Confirm each manifest declares only its matching host.
- Install, repair, update, and remove each product independently.
- Verify the hosted task pane from Windows Office, macOS Office, and Office web.
- Verify that clearing Office-web browser storage changes health to
needs-repairinstead of leaving a falseinstalledstate.
Hosted smoke test
Live Office binding test
Office on the web is the fastest real-host acceptance test:- Deploy the runtime and gateway to public HTTPS origins, then run
test:hosted. - Open a document at
word.office.com,excel.office.com, orpowerpoint.office.com. - Upload the matching manifest (
word.xml,excel.xml, orpowerpoint.xml) via Home → Add-ins → More Add-ins → My Add-ins → Upload My Add-in. - Open Allternit for Word/Excel/PowerPoint from the ribbon and connect your account.
- Start a suggested action and confirm it attaches to the same document binding.
- Run the binding test against the gateway: