Official
chat
Built-in chat UI (JavaScript UI plugin).
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/chat@0.2.6
Permissions in 0.2.6
Files
controller.ts25.1 KB
// The controller owns pane-scoped state and the Effect services used by actions.
// Views receive their own runner, so handlers always execute in the plugin scope.
import { writesFile } from "./segments.ts";
import type * as Context from "effect/Context";
import * as Effect from "effect/Effect";
import * as Semaphore from "effect/Semaphore";
import * as Scope from "effect/Scope";
import type { Api, Chat, ConfigOption, ViewHandle, Element, HostMethods } from "divergence";
import { App, Host, Kernel, Notify, Views } from "divergence/effect";
import type {
EffectClient,
EffectViewContext,
HostError,
KernelCallFailed,
ParseFailed,
PermissionNotGranted,
} from "divergence/effect";
import type { Tabs } from "../tabs/contract.ts";
import { ChatState, carriedTranscript, initialTranscript, registeredPane } from "./state.ts";
import type { Composer, Pane, Transcript } from "./state.ts";
import { step } from "./switcher.ts";
import { chatsOnScreen, switchable } from "./layout.ts";
import { findTask } from "./subagents.ts";
import { PANEL } from "./session.ts";
import * as data from "./data.ts";
import * as composer from "./composer.ts";
import { ranked } from "./picker.ts";
import { APP_COMMANDS } from "./app-commands.ts";
import * as panes from "./panes.ts";
import * as requests from "./requests.ts";
import type { ModelPicker } from "./models.tsx";
import type { PresentationRoutes } from "./presentations.tsx";
import { Scheduler, unknownMethod } from "./scheduler.ts";
import { Drafts } from "./drafts.ts";
import { Answers } from "./answers.ts";
export type ChatError = HostError | KernelCallFailed | ParseFailed | PermissionNotGranted;
export type ChatView = { controller: Controller; ctx: EffectViewContext<object> };
export type Services = {
api: Api;
host: Context.Service.Shape<typeof Host>;
kernel: Context.Service.Shape<typeof Kernel>;
app: Context.Service.Shape<typeof App>;
notify: Context.Service.Shape<typeof Notify>;
views: Context.Service.Shape<typeof Views>;
scope: Scope.Scope;
};
export class Controller {
readonly state = new ChatState();
readonly scheduler = new Scheduler(this);
readonly drafts = new Drafts(this);
readonly answers = new Answers(this);
contextPolicy: HostMethods["host/chats.context_policy"]["result"] | undefined;
private readonly contextLane = Semaphore.makeUnsafe(1);
// Selection and metadata reconciliation share one asynchronous pane-admission owner.
private readonly navigation = Semaphore.makeUnsafe(1);
readonly api: Api;
readonly host: Services["host"];
readonly kernel: Services["kernel"];
readonly app: Services["app"];
readonly notify: Services["notify"];
readonly views: Services["views"];
readonly scope: Scope.Scope;
presentations: PresentationRoutes | null = null;
get center(): Pick<ViewHandle, "update"> | null {
return this.presentations?.center ?? null;
}
get titleView(): Pick<ViewHandle, "update"> | null {
return this.presentations?.title ?? null;
}
settingsView: ViewHandle | null = null;
// The Session panel's rail icon and panel (views/session.ts).
sessionViews: ViewHandle[] = [];
modelPicker: ModelPicker | null = null;
// The divergence/tabs client, set while its provider runs; detail views
// open through it, and stay closed without it.
tabs: EffectClient<typeof Tabs> | undefined;
// The divergence/chat handle is set after the views register; queue and
// draft changes are emitted through it instead of shared app state.
emitQueued: ((queued: string[]) => void) | undefined;
emitDrafts: ((drafts: Record<string, string>) => void) | undefined;
emitStarting: ((starting: string[]) => void) | undefined;
readonly view = { update: () => this.refresh(this.api.app.state().chatId) };
constructor(services: Services) {
this.api = services.api;
this.host = services.host;
this.kernel = services.kernel;
this.app = services.app;
this.notify = services.notify;
this.views = services.views;
this.scope = services.scope;
}
composer(chatId: string): Composer {
return (this.state.composers[chatId] ??= {
text: this.state.restored?.[chatId] ?? "",
agentId: null,
options: [],
commands: [],
skills: [],
loading: true,
picker: null,
files: [],
queue: [],
attachments: [],
});
}
transcript(chatId: string): Transcript {
return (this.state.transcripts[chatId] ??= initialTranscript());
}
isRunning(chat: Pick<Chat, "status"> | undefined): boolean {
return !!chat && ["running", "waiting_approval", "waiting_question"].includes(chat.status);
}
/// A chat nothing was sent in yet: its first prompt starts the chat, so it
/// has the chat queue and no prompt queue.
isDraft(chat: Chat): boolean {
return !chat.sessionId && !this.isRunning(chat) && !this.state.transcripts[chat.id]?.items.length;
}
canHandoff(): boolean {
return (
this.drafts.available === true &&
this.contextPolicy?.available === true &&
(this.contextPolicy.provider !== this.api.plugin || this.api.settings.get("handoffEnabled") !== false)
);
}
loadContextPolicy = Effect.fn("Chat.loadContextPolicy")(() =>
this.contextLane.withPermit(
Effect.gen({ self: this }, function* () {
this.contextPolicy = yield* this.host
.call("host/chats.context_policy", {})
.pipe(
Effect.catch((error) =>
unknownMethod(error) ? Effect.succeed({ provider: null, available: false }) : Effect.fail(error),
),
);
for (const id of Object.keys(this.state.composers)) this.refresh(id);
}).pipe(
Effect.catch((error) => {
this.contextPolicy = undefined;
return this.notify.error(`Could not read the conversation policy: ${data.errorMessage(error)}`);
}),
),
),
);
visibleOptions(c: Composer): ConfigOption[] {
const options = c.options.filter((o) => o.kind === "select");
const model = options.find((o) => o.category === "model");
// With per-model levels (docs/agent-protocol.md) the selected model's
// levels are its reasoning choices, and a model without levels has no
// reasoning control. A choice of the option that no model lists as a
// level (an agent's "let the agent pick") holds for every model, so it
// stays in front of the levels.
const perModel = model?.choices?.some((choice) => choice.reasoningLevels?.length);
const levels = model?.choices?.find((choice) => choice.value === model.value)?.reasoningLevels ?? [];
const listed = new Set(model?.choices?.flatMap((choice) => (choice.reasoningLevels ?? []).map((l) => l.value)));
const reasoningChoices = (o: ConfigOption) =>
levels.length ? [...(o.choices ?? []).filter((choice) => !listed.has(choice.value)), ...levels] : [];
const order = ["mode", "model", "reasoning", "approval"];
const rank = (o: ConfigOption) => {
const i = order.indexOf(o.category);
return i < 0 ? order.length : i;
};
return options
.map((o) => ({ ...o, choices: o.category === "reasoning" && perModel ? reasoningChoices(o) : (o.choices ?? []) }))
.filter((o) => o.choices.length)
.sort((a, b) => rank(a) - rank(b));
}
titleOf(chat: Chat): string {
return this.state.draftTitles[chat.id] ?? chat.title;
}
paneOf(chat: Chat) {
return registeredPane(this.state.panes[chat.id]) ?? null;
}
/// Whether the chat's pane is on screen.
shown(chatId: string): boolean {
return chatsOnScreen(this).has(chatId);
}
/// Renders a chat's pane when it is on screen. A hidden pane (one of the
/// few kept for switching back) renders once when it shows again
/// (`ensurePane`): a chat streaming behind the one on screen rendered its
/// whole transcript on every event, and the plugin had no time to answer.
updatePane(pane: Pane) {
if (this.shown(pane.chatId)) {
pane.view.update();
pane.composer?.update();
} else pane.stale = true;
}
/// Renders only a chat's composer: what typing changes. Without a
/// composer view of its own the pane draws it.
refreshComposer(chatId: string) {
const pane = registeredPane(this.state.panes[chatId]);
if (!pane?.composer) this.refresh(chatId);
else if (this.shown(chatId)) pane.composer.update();
else pane.stale = true;
}
refresh(chatId?: string) {
const chat = chatId ? this.state.chats[chatId] : null;
const pane = chat ? this.paneOf(chat) : null;
if (pane) this.updatePane(pane);
else this.center?.update();
}
/// The transcripts outlive a reload of this plugin in `state`, the center
/// view's `ctx.state` (it survives reloads): a chat opened before shows
/// its rows at once and reads them again, instead of loading cold. Every
/// save of this plugin's files reloads it.
keepTranscripts(state: { transcripts?: Record<string, Transcript> }) {
if (state.transcripts === this.state.transcripts) return;
for (const [id, kept] of Object.entries(state.transcripts ?? {})) {
const current = this.state.transcripts[id];
const carried = carriedTranscript(kept);
if (!current) this.state.transcripts[id] = { ...initialTranscript(), ...carried, carried: true };
else if (current.snapshot.kind !== "ready" && current.version === 0 && !current.items.length) {
const checkpoints = current.checkpoints;
Object.assign(current, carried, { checkpoints });
for (const checkpoint of carried.checkpoints) checkpoints.add(checkpoint);
// A read already in flight must cover the restored rows before replacing them.
current.version++;
}
}
state.transcripts = this.state.transcripts;
}
/// Renders the Session panel and its rail icon again when they show
/// this chat (any chat without an id): they read the chat's options,
/// status, usage and subagents, which change outside their own events.
updateSession(chatId?: string) {
if (chatId && chatId !== this.api.app.state().chatId) return;
for (const view of this.sessionViews) view.update();
}
/// Pins the Session panel as the right column, or puts it away.
toggleSession() {
return this.app.update({
shared: { rightPanel: this.api.app.state().shared?.rightPanel === PANEL ? null : PANEL },
});
}
closeSession() {
return this.app.update({ shared: { rightPanel: null } });
}
// A subagent's or a workflow's tab draws again when its chat's tasks change.
refreshSubagentTabs = (_chatId: string) => {
this.api.layouts.redraw();
};
redraw = (chatId: string) => {
this.view.update();
this.refreshSubagentTabs(chatId);
};
toggle = (set: Set<string>, id: string) => {
if (!set.delete(id)) set.add(id);
this.view.update();
};
/** Notes what the kernel says of a clamped prompt (`clampedPrompt`), drawing again only when that changes. */
noteClamp = (set: Set<string>, id: string, clamped: boolean) => {
if (set.has(id) === clamped) return;
if (clamped) set.add(id);
else set.delete(id);
this.view.update();
};
switchBy = (delta: number, input: "native" | "overlay" = "overlay") => {
const allowed = switchable(this);
const chats = Object.fromEntries(Object.entries(this.state.chats).filter(([id]) => allowed(id)));
const recent = this.state.recent.filter(allowed);
const next = step(this.state.switcher, chats, recent, this.api.app.state().chatId, delta, input);
if (next) {
this.state.switcher = next;
this.presentations?.updateSwitcher();
// The selected chat opens when the switcher closes: read it now.
if (next.selected) Effect.runFork(this.prefetch(next.selected));
}
};
closeSwitcher = () => {
if (this.state.switcher) {
this.state.switcher = null;
this.presentations?.updateSwitcher();
}
};
commitSwitcher = Effect.fn("Chat.commitSwitcher")(
function* (this: Controller) {
const chosen = this.state.switcher?.selected;
if (!this.state.switcher) return;
this.closeSwitcher();
const chat = chosen ? this.state.chats[chosen] : null;
if (chat && chat.id !== this.api.app.state().chatId) yield* this.app.select(chat.id, chat.workspaceId);
}.bind(this),
);
takesImages(chatId: string): boolean {
const chat = this.state.chats[chatId];
return (chat ? this.state.agents[chat.agentId]?.capabilities?.images : undefined) !== false;
}
canStopTask(chat: Chat): boolean {
return !!this.state.agents[chat.agentId]?.capabilities?.cancelTask;
}
inWorkflow(chatId: string, task: { parentTaskId?: string }): boolean {
return !!task.parentTaskId && !!findTask(this.transcript(chatId).items, task.parentTaskId)?.task.workflow;
}
/// Every command the composer offers: the agent's, then the plugins'.
/// The host lists the plugins' commands after the agent's already, and a
/// plugin's command runs in place of an agent's of the same name: one
/// entry per name, the one that runs.
commandList(c: Composer) {
const plugin = this.api.slashCommands().map((command) => ({
name: command.name,
description: `${command.description} (${command.plugin})`,
inputHint: command.inputHint,
source: "plugin",
}));
const names = new Set(plugin.map((command) => command.name));
// The app's own commands are listed by the picker on their own, ahead
// of these, and run in place of an agent's of the same name.
return [...c.commands.filter((command) => !names.has(command.name)), ...plugin].filter(
(command) => !APP_COMMANDS.has(command.name),
);
}
matchingCommands(c: Composer, query: string) {
return ranked(this.commandList(c), query, (command) => command.description ?? "");
}
matchingSkills(c: Composer, query: string) {
return ranked(c.skills, query, (skill) => skill.description ?? "");
}
/// A message as the user wrote it: its text with each file reference and
/// skill where it stands (`@path`, `$name input`), and a line between two
/// text blocks (a mention's instructions). A message saved before
/// references stood in place has each `@path` in its text already and the
/// reference after it: that one is not written again.
plainText(blocks: readonly import("divergence").ContentBlock[]): string {
let out = "",
typed = "",
text = false;
for (const block of blocks) {
if (block.type === "text") {
out += (text && !block.text.startsWith("\n") ? "\n" : "") + block.text;
typed += block.text;
text = true;
} else if (block.type === "file_ref") {
if (writesFile(typed, block.path)) continue;
const ref = `@${block.path}`;
out += ref;
text = false;
} else if (block.type === "skill") {
out += `$${block.name}${block.input ? ` ${block.input}` : ""}`;
typed += ` ${block.input ?? ""}`;
text = false;
}
}
return out;
}
imagesOf(item: import("./state.ts").UserItem): string[] {
const known = this.state.itemImages[item.id];
return known && known !== "pending" ? known : [];
}
renderModelPicker(
v: ChatView,
chat: Chat,
model: ConfigOption | undefined,
extras: ConfigOption[],
fit?: "label" | "icon" | "bare",
): Element | null {
return this.modelPicker?.render(v, chat, model, extras, fit) ?? null;
}
loadRecent(...args: Tail<Parameters<typeof data.loadRecent>>): ReturnType<typeof data.loadRecent> {
return data.loadRecent(this, ...args);
}
noteRecent(...args: Tail<Parameters<typeof data.noteRecent>>): ReturnType<typeof data.noteRecent> {
return data.noteRecent(this, ...args);
}
syncDraftTitle(...args: Tail<Parameters<typeof data.syncDraftTitle>>): ReturnType<typeof data.syncDraftTitle> {
return data.syncDraftTitle(this, ...args);
}
syncDraftTitles(...args: Tail<Parameters<typeof data.syncDraftTitles>>): ReturnType<typeof data.syncDraftTitles> {
return data.syncDraftTitles(this, ...args);
}
saveUnsent(...args: Tail<Parameters<typeof data.saveUnsent>>): ReturnType<typeof data.saveUnsent> {
return data.saveUnsent(this, ...args);
}
textChanged(...args: Tail<Parameters<typeof data.textChanged>>): ReturnType<typeof data.textChanged> {
return data.textChanged(this, ...args);
}
restoreUnsent(...args: Tail<Parameters<typeof data.restoreUnsent>>): ReturnType<typeof data.restoreUnsent> {
return data.restoreUnsent(this, ...args);
}
persistQueues(...args: Tail<Parameters<typeof data.persistQueues>>): ReturnType<typeof data.persistQueues> {
return data.persistQueues(this, ...args);
}
restoreQueues(...args: Tail<Parameters<typeof data.restoreQueues>>): ReturnType<typeof data.restoreQueues> {
return data.restoreQueues(this, ...args);
}
loadOptions(...args: Tail<Parameters<typeof data.loadOptions>>): ReturnType<typeof data.loadOptions> {
return data.loadOptions(this, ...args);
}
preloadChats(...args: Tail<Parameters<typeof data.preloadChats>>): ReturnType<typeof data.preloadChats> {
return data.preloadChats(this, ...args).pipe(Effect.tap(() => {
const id = this.api.app.state().chatId;
return id && this.state.chats[id] ? this.followApp() : Effect.void;
}));
}
loadChat(...args: Tail<Parameters<typeof data.loadChat>>): ReturnType<typeof data.loadChat> {
return data.loadChat(this, ...args).pipe(Effect.tap(() => {
const id = this.api.app.state().chatId;
return id && this.state.chats[id] ? this.followApp() : Effect.void;
}));
}
loadWorkspaces(...args: Tail<Parameters<typeof data.loadWorkspaces>>): ReturnType<typeof data.loadWorkspaces> {
return data.loadWorkspaces(this, ...args);
}
refreshHistory(...args: Tail<Parameters<typeof data.refreshHistory>>): ReturnType<typeof data.refreshHistory> {
return data.refreshHistory(this, ...args);
}
loadOlder(...args: Tail<Parameters<typeof data.loadOlder>>): ReturnType<typeof data.loadOlder> {
return data.loadOlder(this, ...args);
}
prefetch(chatId: string): Effect.Effect<void> {
return panes.prehydratePresentation(this, chatId).pipe(Effect.catch(() => Effect.void));
}
loadTranscript(...args: Tail<Parameters<typeof data.loadTranscript>>): ReturnType<typeof data.loadTranscript> {
return data.loadTranscript(this, ...args);
}
loadRequests(...args: Tail<Parameters<typeof data.loadRequests>>): ReturnType<typeof data.loadRequests> {
return data.loadRequests(this, ...args);
}
tickSubagents(...args: Tail<Parameters<typeof data.tickSubagents>>): ReturnType<typeof data.tickSubagents> {
return data.tickSubagents(this, ...args);
}
onChange(...args: Tail<Parameters<typeof composer.onChange>>): ReturnType<typeof composer.onChange> {
return composer.onChange(this, ...args);
}
quote(...args: Tail<Parameters<typeof composer.quote>>): ReturnType<typeof composer.quote> {
return composer.quote(this, ...args);
}
quoteInOpenChat(
...args: Tail<Parameters<typeof composer.quoteInOpenChat>>
): ReturnType<typeof composer.quoteInOpenChat> {
return composer.quoteInOpenChat(this, ...args);
}
acceptEntry(...args: Tail<Parameters<typeof composer.acceptEntry>>): ReturnType<typeof composer.acceptEntry> {
return composer.acceptEntry(this, ...args);
}
keepNewImages(...args: Tail<Parameters<typeof composer.keepNewImages>>): ReturnType<typeof composer.keepNewImages> {
return composer.keepNewImages(this, ...args);
}
refuseImages(...args: Tail<Parameters<typeof composer.refuseImages>>): ReturnType<typeof composer.refuseImages> {
return composer.refuseImages(this, ...args);
}
attachFiles(...args: Tail<Parameters<typeof composer.attachFiles>>): ReturnType<typeof composer.attachFiles> {
return composer.attachFiles(this, ...args);
}
onPasteFiles(...args: Tail<Parameters<typeof composer.onPasteFiles>>): ReturnType<typeof composer.onPasteFiles> {
return composer.onPasteFiles(this, ...args);
}
removeAttachment(
...args: Tail<Parameters<typeof composer.removeAttachment>>
): ReturnType<typeof composer.removeAttachment> {
return composer.removeAttachment(this, ...args);
}
pickAttachments(
...args: Tail<Parameters<typeof composer.pickAttachments>>
): ReturnType<typeof composer.pickAttachments> {
return composer.pickAttachments(this, ...args);
}
onSubmit(...args: Tail<Parameters<typeof composer.onSubmit>>): ReturnType<typeof composer.onSubmit> {
return composer.onSubmit(this, ...args);
}
sendBlocks(...args: Tail<Parameters<typeof composer.sendBlocks>>): ReturnType<typeof composer.sendBlocks> {
return composer.sendBlocks(this, ...args);
}
send(...args: Tail<Parameters<typeof composer.send>>): ReturnType<typeof composer.send> {
return composer.send(this, ...args);
}
queuePrompt(...args: Tail<Parameters<typeof composer.queuePrompt>>): ReturnType<typeof composer.queuePrompt> {
return composer.queuePrompt(this, ...args);
}
submitDraft(...args: Tail<Parameters<typeof composer.submitDraft>>): ReturnType<typeof composer.submitDraft> {
return composer.submitDraft(this, ...args);
}
dropQueuedPrompt(
...args: Tail<Parameters<typeof composer.dropQueuedPrompt>>
): ReturnType<typeof composer.dropQueuedPrompt> {
return composer.dropQueuedPrompt(this, ...args);
}
sendText(...args: Tail<Parameters<typeof composer.sendText>>): ReturnType<typeof composer.sendText> {
return composer.sendText(this, ...args);
}
queueChat(...args: Tail<Parameters<typeof composer.queueChat>>): ReturnType<typeof composer.queueChat> {
return composer.queueChat(this, ...args);
}
unqueueChat(...args: Tail<Parameters<typeof composer.unqueueChat>>): ReturnType<typeof composer.unqueueChat> {
return composer.unqueueChat(this, ...args);
}
pumpChatQueue(...args: Tail<Parameters<typeof composer.pumpChatQueue>>): ReturnType<typeof composer.pumpChatQueue> {
return composer.pumpChatQueue(this, ...args);
}
setOption(...args: Tail<Parameters<typeof composer.setOption>>): ReturnType<typeof composer.setOption> {
return composer.setOption(this, ...args);
}
changeAgent(...args: Tail<Parameters<typeof composer.changeAgent>>): ReturnType<typeof composer.changeAgent> {
return composer.changeAgent(this, ...args);
}
regenerateTranscripts(chatId: string) {
return composer.regenerateTranscripts(this, chatId);
}
moveDraft(...args: Tail<Parameters<typeof composer.moveDraft>>): ReturnType<typeof composer.moveDraft> {
return composer.moveDraft(this, ...args);
}
moveDraftToNewWorkspace(
...args: Tail<Parameters<typeof composer.moveDraftToNewWorkspace>>
): ReturnType<typeof composer.moveDraftToNewWorkspace> {
return composer.moveDraftToNewWorkspace(this, ...args);
}
ensureComposer(...args: Tail<Parameters<typeof panes.ensureComposer>>): ReturnType<typeof panes.ensureComposer> {
return panes.ensureComposer(this, ...args);
}
ensureChat(...args: Tail<Parameters<typeof panes.ensureChat>>): ReturnType<typeof panes.ensureChat> {
return panes.ensureChat(this, ...args);
}
removePane(chatId: string) {
panes.removePane(this, chatId);
}
followApp(...args: Tail<Parameters<typeof panes.followApp>>): Effect.Effect<void> {
return this.navigation.withPermit(panes.followApp(this, ...args)).pipe(
Effect.catch((error) => this.notify.error(`The conversation could not be opened: ${data.errorMessage(error)}`)),
);
}
followAppChanges = Effect.fn("Chat.followAppChanges")(function* (this: Controller) {
const reconcile = () => { Effect.runFork(Effect.forkIn(this.followApp(), this.scope, { startImmediately: true })); };
yield* Effect.acquireRelease(
Effect.sync(() => this.api.app.onChange(reconcile)),
(stop) => Effect.sync(stop),
).pipe(Effect.provideService(Scope.Scope, this.scope));
// Admission starts in the notification turn, before views are marked dirty.
reconcile();
});
openWorkflow(...args: Tail<Parameters<typeof panes.openWorkflow>>): ReturnType<typeof panes.openWorkflow> {
return panes.openWorkflow(this, ...args);
}
openSubagent(...args: Tail<Parameters<typeof panes.openSubagent>>): ReturnType<typeof panes.openSubagent> {
return panes.openSubagent(this, ...args);
}
respondQuestion(
...args: Tail<Parameters<typeof requests.respondQuestion>>
): ReturnType<typeof requests.respondQuestion> {
return requests.respondQuestion(this, ...args);
}
openQuestionLink(
...args: Tail<Parameters<typeof requests.openQuestionLink>>
): ReturnType<typeof requests.openQuestionLink> {
return requests.openQuestionLink(this, ...args);
}
submitEdit(...args: Tail<Parameters<typeof requests.submitEdit>>): ReturnType<typeof requests.submitEdit> {
return requests.submitEdit(this, ...args);
}
revert(...args: Tail<Parameters<typeof requests.revert>>): ReturnType<typeof requests.revert> {
return requests.revert(this, ...args);
}
fork(...args: Tail<Parameters<typeof requests.fork>>): ReturnType<typeof requests.fork> {
return requests.fork(this, ...args);
}
copyMessage(...args: Tail<Parameters<typeof requests.copyMessage>>): ReturnType<typeof requests.copyMessage> {
return requests.copyMessage(this, ...args);
}
stopTask(...args: Tail<Parameters<typeof requests.stopTask>>): ReturnType<typeof requests.stopTask> {
return requests.stopTask(this, ...args);
}
loadImages(...args: Tail<Parameters<typeof requests.loadImages>>): ReturnType<typeof requests.loadImages> {
return requests.loadImages(this, ...args);
}
}
type Tail<T extends readonly unknown[]> = T extends readonly [unknown, ...infer Rest] ? Rest : never;Versions
| Version | Published | Plugin API | Size | Permissions | Status |
|---|---|---|---|---|---|
| 0.2.9latest | Nov 21, 2026 | >=5 <6 | 349 KB | 5 permissions | Listed |
| 0.2.8 | Nov 16, 2026 | >=5 <6 | 348.6 KB | 5 permissions | Listed |
| 0.2.7 | Nov 11, 2026 | >=5 <6 | 314.3 KB | 5 permissions | Listed |
| 0.2.6 | Nov 9, 2026 | >=5 <6 | 306.2 KB | 5 permissions | Listed |
| 0.2.5 | Oct 27, 2026 | >=2 <4 | 178.6 KB | 5 permissions | Listed |
No comments yet.