Audience: Developer
A plugin task becomes an assistant ability by describing it: what kind of thing it acts on, whether that thing must already exist, a one-line description with a few alternative phrasings, whether a person must approve it, whether repeating it is safe, and whether its result can sit in the user’s working copy or must run when the user saves.
A plugin can also introduce a new kind of thing by saying how to find one by name and how to load one by id.
| Field | Meaning |
|---|---|
| Kind of thing | What the ability acts on (for example media) |
| Must already exist | Existing subject, new subject, or none |
| Description + aliases | One-line description and alternative phrasings people might say |
| Approval | Whether a person must approve before it runs |
| Repeat-safe | Whether running it again is safe |
| Stage | Result can sit in the working copy, or must run when the user saves |
Do not describe how the assistant chooses between abilities — only declare what your task is.
User experience: “remove EXIF from hero.jpg” becomes one step on that file.
In prose:
SDK shapes live on ToolTaskDecl.agent (AgentTaskDecl in @lokakrt/sdk):
import type { ToolTaskDecl } from '@lokakrt/sdk';
const strip: ToolTaskDecl = {
key: 'strip',
label: 'Strip Exif',
description: 'Remove EXIF metadata from a media image',
agent: {
kind: 'media',
subject: 'existing',
approval: 'always',
aliases: ['strip EXIF', 'remove metadata', 'remove EXIF'],
permission: 'Media',
stage: 'at-save',
repeatSafe: true,
},
};
Fill remaining declaration fields from AgentTaskDecl in @lokakrt/sdk (including how the ability’s arguments are shaped).
See also Strip Exif (Developer). Host behavior when a plugin is enabled or disabled: Plugin host.