Capabilities
Plugins declare in `requires` what they need from the phone. If the phone can't provide it, the harness hides the plugin and tells the user why.
A phone is different from a computer. Plugins on a phone have no shell and no filesystem that the user can see, and their time in the background is limited. Some campus websites can also only be reached from the campus network.
For this reason, each plugin states what it needs from the phone. A plugin lists these
capabilities in PluginDef.requires, and its registry entry has the same requires list. The
harness compares the list with what the phone actually offers. If any capability is missing, the
plugin is hidden from the agent, its tool calls are refused, and Settings shows the reason.
For example, the finance plugin needs a signed-in campus session and the campus network:
definePlugin({
id: 'finance',
// …
requires: ['campus-session', 'campus-network'],
});The capabilities
| Capability | Meaning | Available today |
|---|---|---|
network | General internet access | Yes |
campus-network | Sites that can only be reached from the PKU network | Yes (see below) |
campus-session | Signed-in campus requests made through the host | Android only |
notifications | Local notifications | Yes |
background | Running in the background from time to time | Yes |
cloud | A PKU harness Cloud provider is set up | When a provider is set up |
ongoing | A persistent notification or foreground service | Android only |
phone-control | Operating other apps on the phone (Copilot, through services.phone) | Android 12 or later |
shell | A command-line shell | Never on phones |
filesystem | A filesystem | Not offered to plugins |
Some of these need a little more explanation.
networkmeans internet access with a plainfetch.campus-networkis always declared as available in the app. If the phone is not on the campus network, however, the request fails.campus-sessionmeans signed-in campus requests made through the host'sservices.campus. The plugin never sees the credentials. It depends on the native campus-http module, so for now it is only available on Android. iOS will get it once the module is ported to Swift.cloudfollows your settings as they change. It is available while you have a Cloud provider set up, and unavailable once you remove it.ongoingcorresponds toservices.ongoing, which shows a persistent notification or runs a foreground service.shellis never available on phones. A plugin that needs a shell must be a remote plugin.filesystemis not offered to plugins. For a file the user chooses, useservices.files.pick.
Rules
- You must list every capability that the plugin's tools depend on. A plugin that calls
services.campus.requestrequirescampus-session. If it also reaches a site that only works on the campus network, it requirescampus-networktoo. - A bundled plugin must not require
shellorfilesystem. Heavy work, such as scraping many pages, text recognition (OCR) or long-running jobs, belongs in a remote plugin. - Remote plugins run on a server, so
shellis not something the phone has to provide for them. The registry validator rejectsrequires: ['shell']in remote entries. - You should check that an optional service exists before using it. Without the
ongoingcapability,services.ongoingisundefined. On a host without cloud support,ctx.cloudisundefined. - A plugin that also works without the cloud should declare
cloud.optional: trueinstead of requiringcloud. Checkctx.cloud?.availablebefore using it.
Permissions and consent
For each effect of each plugin, you decide whether the agent may act directly, must ask first, or may not act at all. Scheduled runs only read.
Host services
Whenever a bundled plugin needs to do something outside itself, it goes through `HostServices`. The harness passes it in as `ctx.services` in tools and as `props.services` in screens and widgets.