Skip to main content

When a package needs another package to run work, call a named Bitfield target. Do not import the implementation function directly.

A keyboard package changes the selected agent. A notifications package changes the notification mode. A search box asks a search target for results. In traditional code, these become direct service calls. In Bitfield, they are action requests.A correct caller uses the action name and payload shape. It does not import the implementation file for the work.

Traditional app shape

That direct call now depends on the selected-agent package implementation. If the implementation moves, changes runtime, or becomes a slot, the caller changes too.

Bitfield shape

The action name is the public target. The implementation can change without making the caller import new code.

Code translation

Good action requests

Each request names the job and sends the smallest public payload needed for that job.

Four request situations

Refresh a preview

Direct service call

Use the action name

The caller uses the job name and payload. It does not import the implementation file.

Change selected agent

Direct store mutation

Ask for the change

The same request can come from a keyboard shortcut, command palette, sidebar, or future shell.

Update notification mode

Direct package function

Send the public request

Settings and command surfaces can call the same public action without sharing notification package code.

Search help content

Private search import

Search through the target

The caller sends the question. The package that owns the searchable material decides how to answer.

Request versus state

Reply and error boundary

The caller may use the reply shape. It must not import the implementation path.
If the target returns bytes, text, JSON, or a structured result, the page that defines the target should say that. The caller should decode only the documented reply shape.

Review checklist

What this prevents

React is one adapter that can send an action request. The same target should make sense from a keyboard shortcut, a terminal command, a Swift screen, a background job, or a future shell.

Common failures

Review check

If caller code imports a function from another package to “do work,” stop. The public API is an action request. The caller may use the action name, payload, reply shape, and error states. It must not import the implementation file.

Next

Last modified on May 10, 2026