Skip to main content
Build the first-party infiniti.rewrite source and run it locally. You will finish with a .clipsx archive and a transformation result attached to a harmless sample clip. This is a guided build of an existing package; use it to learn the contract before making a new package with your own identity.

Prerequisites

  • Git, Node.js with npm, and Rust installed through rustup.
  • The native Tauri build prerequisites for your operating system: the wrapper builds a tool from the desktop repository.
  • A ClipsX desktop build compatible with Extension API v3.2. Confirm that the source tooling and installed app support the same contract; a newer source checkout does not upgrade your installed app. Check the extension contract and available desktop builds.
  • A working generation model for the runtime exercise. Follow Local AI setup. Building and validating the archive does not require Ollama to be running.
Add the guest compilation target:
The guest uses the pinned no-WASI contract. Keep sdk/wit/clipsx-extension.wit and the host WIT aligned; do not change the API version to bypass compatibility errors.

Get the source

Run these commands in a new working directory. The two checkouts must be siblings for the default wrapper to locate the host:
Use revisions that support the same contract. For reproducible builds, record git rev-parse HEAD in each checkout. This guide does not require building or releasing a new desktop installer. If your host checkout is elsewhere, set CLIPSX_REPO to its absolute path in the current shell before running package commands:

Build and validate the archive

From the clipsx-extensions checkout:
The script runs the guest’s Rust tests, builds its release WASM, copies it to the package root, packs twice to check deterministic bytes, and runs archive validation, inspection, and component checks. The first host-tool build may take longer and use substantial disk space. A successful run prints the package ID, version, output filename, and SHA-256 digest. Inspect or recheck the exact archive:
The test command checks compatibility, manifest, assets, limits, and component structure. It does not run the model or verify a desktop interaction. The output archive is a local development artifact, not a published or signed release.

Import it into ClipsX

  1. Open Settings → Extensions → Developer.
  2. Enable Allow local packages.
  3. Choose Install local .clipsx package and select dist/rewrite-local.clipsx.
  4. Read the requested permissions before consenting. Rewrite requests selected input and generation; it also declares capabilities for optional copy-triggered automation.
  5. Find Rewrite under Installed and ensure it is enabled.
The package ID is still infiniti.rewrite. If you already have the registry version installed, this is the same package identity, not a separate demo. Review the existing installation before replacing it. Developer Mode permits unsigned packages; leave it off when you no longer need local imports. Existing permissions still apply.

Verify a first result

  1. In Intelligence → Models → Usage & defaults, assign a chat preset to Extension text generation. Verify its connection and model are available.
  2. Copy this harmless sample:
  1. Open the clip and choose Rewrite, then Business.
  2. Run the transformation. Inspect the result and compare it with Original.
  3. Copy the result deliberately, or choose Save as new clip to keep an independent clip.
Success means a completed result is attached to the source and remains accessible after reopening the clip. Expect a more formal version of the request, but not specific wording: output depends on the model and may change meaning. Check it before using it. Running a transformation does not automatically replace the system clipboard. Deleting the source also removes its attached results. Automatic rules are optional and are not needed for this exercise. If you enable them later, use a narrow application scope and harmless content first. They apply to accepted new copies, not a replay of old history.

Understand and change the example

Read these source files before changing behavior:
  • Manifest: package identity, permissions, the transformer, parameters, named setups, and activation.
  • Rust guest: generation requests, validation, output, and tests.
  • Pinned WIT: the guest/host interface.
Start without a source change: use Custom with the instruction “Keep technical terms unchanged and make the request concise.” To change the guest, modify one behavior, add a relevant Rust test, rebuild the archive, and import the new bytes. Review permissions again when prompted. The host chooses the configured provider and keeps its endpoint, model, and credentials out of the guest. The package returns a named result; the host owns jobs, result storage, Copy, Paste, Regenerate, and Save controls. Do not add direct clipboard writes or store generated output in package state. When creating a different extension, choose your own package ID and metadata; keep the first-party identity only for studying this example. The repository’s package script is limited to its listed first-party packages. New packages use the host CLI’s pack, validate, inspect, and test commands described in the contract.

Recover from common failures

Local testing and distribution

Before distributing a change, test manual execution, cancellation, missing-model recovery, restart, source deletion, and saving a result as an independent clip. If you implement automation, also test rule consent, source scope, and that execution never automatically writes to the system clipboard. Public distribution is a separate process: immutable release archives, checksum and permission metadata, and catalog review and signing. A successful local build does not grant registry publication or certify platform behavior. Follow the extension repository instructions and registry instructions before proposing a release. Validation and signatures do not guarantee package safety.