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 same ExtensionSidepanelShell 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

These commands use office-addin-debugging — the Office equivalent of Chrome’s Load unpacked.

Architecture

Key files in the task pane runtime:

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.
The platform companion and the task pane read the same backend records under the same user and organization identity.

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.
A runtime session record is shared by the task pane and the platform companion:
The task pane stores bindings locally via 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 under plugins/{excel,powerpoint,word}/:
The plugin loader (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 by buildToolCallCode() 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 through executeCode() 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

  1. The add-in exports the live document with Office.getFileAsync (compressed .docx/.xlsx/.pptx bytes, sliced).
  2. The binary body is uploaded to POST /api/v1/office/cli/document.
  3. All officecli tools run against that server-side snapshot.
  4. 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

  • officecli must be installed on the gateway host (brew install officecli or the official installer); override with OFFICECLI_BIN.
  • Production should disable auto-update: officecli config autoUpdate false.
  • ALLTERNIT_OFFICECLI_LIVE_FS gates 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 through office-addin-manager.ts:
  • detect
  • install
  • update
  • repair
  • remove
The manager only touches Allternit-owned registrations and never modifies unrelated Office add-ins.

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:
The ?product= query identifies the companion preview; a live Office.js host is still required before the pane reports document access.

Deployment

Prepare production assets

Publish the contents of 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-repair instead of leaving a false installed state.

Hosted smoke test

This rejects SPA fallbacks, validates content types, follows built assets, checks stable unique IDs, and confirms that every manifest declares exactly one matching Office host.

Live Office binding test

Office on the web is the fastest real-host acceptance test:
  1. Deploy the runtime and gateway to public HTTPS origins, then run test:hosted.
  2. Open a document at word.office.com, excel.office.com, or powerpoint.office.com.
  3. Upload the matching manifest (word.xml, excel.xml, or powerpoint.xml) via Home → Add-ins → More Add-ins → My Add-ins → Upload My Add-in.
  4. Open Allternit for Word/Excel/PowerPoint from the ribbon and connect your account.
  5. Start a suggested action and confirm it attaches to the same document binding.
  6. Run the binding test against the gateway:
A pass requires a connected binding with at least one active Office session; merely rendering the task pane webpage does not pass.