Skip to content

Last updated:

aquilifer-types ​

A companion package: TypeScript types for window.aquilifer, so a website integrating Aquilifer gets full typing without hand-copying shapes from the page-facing API docs. Published on npm; source lives at github.com/On0n0k1/aquilifer-types.

Installing it ​

sh
npm install aquilifer-types

Its types are hand-ported from this repo's own lib/public-api.ts and kept in sync with it. See the package's own README for usage examples; the shapes it exports match what the page-facing API and its generic, Anthropic Claude, and OpenAI-compatible sub-pages document.

What it ships ​

  • The window.aquilifer type declaration itself, plus every type it depends on (across the page-facing API and its generic, Anthropic Claude, and OpenAI-compatible sub-pages).
  • The provider-specific request/response/stream types, derived from the official @anthropic-ai/sdk and openai packages so they track each provider's own API shape rather than a hand-maintained copy.
  • Two small runtime helpers: getAquilifer() (returns window.aquilifer if present, undefined otherwise) and isAquiliferAvailable() (the same check as a boolean). Small enough that there's exactly one sane behavior for each, nothing to get wrong in a first release.
  • Zero runtime cost for the types themselves: everything is erased at compile time, the same way Aquilifer's own extension code only ever import types from the official provider SDKs.

What it won't ship yet ​

  • A fallback-pattern helper (see Using Aquilifer as a fallback). Nobody's built a real fallback integration against Aquilifer yet, and this needs real usage to design against rather than guessing upfront and risking a breaking change later.
  • Any backend or server code. window.aquilifer only exists inside a browser tab with the extension installed, so a package aimed at server code would be solving a problem that doesn't exist here.

Which package to install ​

aquilifer-types — published on npm, and the one this page documents.

There is also a package published under the bare name aquilifer, with no -types suffix. That one is not this package and isn't meant to be installed: it's a minimal stub holding the name against squatting, with no types and no code in it. npm has no way to reserve a name without publishing something under it, which is the only reason it exists.

The extension itself isn't on npm under either name — it ships through the Chrome Web Store. Installing aquilifer-types gives a site's own code the types for window.aquilifer; it neither installs the extension nor requires visitors to have it.

Released under the Apache License 2.0.